Re: Load javascript on the fly

2011-03-14 Thread brucko
I believe you will be prevented from loading the facebook script with GWT due to the browser single source policy. The other suggestions I think are your best option for loading the script - of course you can always call init from GWT. On Mar 14, 9:46 am, Simon M wrote: > Yes that would be easier

Re: Load javascript on the fly

2011-03-14 Thread Simon M
For reference a fine solution is here : http://technowobble.blogspot.com/2010/06/how-to-integrate-facebooks-javascript.html -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-toolkit@googlegroup

Re: Load javascript on the fly

2011-03-13 Thread Simon M
Yes that would be easier but I don't want to load the Facebook javascript everytime, only when it is needed. I think the issue happened because the FB object was called before the script was loaded. So I added some code to wait until the code is loaded: private native void initFacebook(String

Re: Load javascript on the fly

2011-03-13 Thread khiem nguyen
maybe you should try to include the script in module.gwt.xml file instead ? On Sun, Mar 13, 2011 at 8:27 PM, Simon M wrote: > I try to integrate with Facebook. I want to load the javascript file from > Facebook dynamically. > > I created the following method to load the js file and then initia

Load javascript on the fly

2011-03-13 Thread Simon M
I try to integrate with Facebook. I want to load the javascript file from Facebook dynamically. I created the following method to load the js file and then initialize FB: private native void initFacebook(String fbAppId) /*-{ var script = document.createElement("script"); script.src = "http://con