Closed confile closed 11 years ago
It looks like jQuery is not defined. Can you check in your source code if it is inserted in your html head JS scripts?
Are you using the Cache Resources plugin? If you do, you might want to disable it to know the source of the error.
You can also check in the source code if the FB SDK is correctly initialized.
As I wrote I use version 0.4.6 of your plugin and it is working. When I only change to 0.4.8 it does not work. Nothing else has changed. Yes I use Cache Resources plugin.
I'm sorry, but I can't reproduce your issue. This is what I did:
Could you give me some more context on how to reproduce this issue?
Thanks.
@benorama I think I found what is going wrong. Here is what I use with 0.4.6
main layout at the bottom:
<facebook:initJS appId="${grailsApplication.config.grails.plugin.facebooksdk.appId}" xfbml="${true}" locale="de_DE">
</facebook:initJS>
This is not working anymore with 0.4.9 but if you delete locale="de_DE" it is working. So I guess that some error must be in the taglib. What do you think?
(In your docu http://benorama.github.com/grails-facebook-sdk/ref/tags/initJS.html it must be "simply insert initJS tag, after HTML
tag and before ")Indeed, you need to pass a java Locale (http://docs.oracle.com/javase/7/docs/api/java/util/Locale.html). This is what we use to get current request locale.
<facebook:initJS
appId="${facebookContext.app.id}"
locale="${RequestContextUtils.getLocale(request)}"
xfbml="${true}">
@benorama where do I get RequestContextUtils in a Grails GSP? Do I have to add
import org.springframework.web.servlet.support.RequestContextUtils
in every Controller or is there a better way?
You are not using an IDE? Intellij IDEA is a must for Grails development. It will accelerate your development. For example, it will automatically insert in your GSP:
<%@ page import="org.springframework.web.servlet.support.RequestContextUtils" %>
@benorama I am using GGTS. What about that?
GGTS is fine, but you might give a try to Intellij with the Free 30 days trial. It's like working on a PC and then on a Mac : you cannot go back once you're addicted... ;)
At the top of the GSP where you want to use RequestContextUtils
Okay it is working thank you.
Version 0.4.6 works perfect, but when I switched to version 0.4.8
I got the console errors while running the app:
What do I have to change? Any idea? Nothing has changed and still Jquery is available as before.