May be with a bit of code... It's to add a twitter stream widget to my
page.


ScriptInjector.fromUrl("http://widgets.twimg.com/j/2/
widget.js").setCallback(new Callback<Void, Exception>() {

        @Override
        public void onSuccess(Void result) {
                JavascriptInjector.inject(((ScriptResources)
GWT.create(ScriptResources.class)).twitterWidget().getText(),
panel.getElement());
        }

        @Override
        public void onFailure(Exception reason) {
        }
}).inject();

JavaScriptInjector is a custom made injector based on
http://www.amateurinmotion.com/articles/2009/09/07/injecting-javascript-in-gwt-2.html
I inject the local twitter widget code in a div (!) just as if it was
added in a HTML page.

The twitter code is:
new TWTR.Widget({
 // some parameters
}).render().setUser('User_Name').start();


The error message is unknown TWTR

The twitter library loads well.


On Oct 18, 9:49 pm, Thomas Lefort <[email protected]> wrote:
> Hi I'm using ScriptInjector to load a library first and added a
> callback calling a new ScriptInjector, this time with a string js. The
> local js calls a function that is implemented by the loaded library.
> The library loads well but the local script won't execute because it
> can't find the library function... as if it was in a different
> namespace or else.
>
> Any idea? I looked for examples but couldn't find any so far.
>
> Thanks for any help,
>
> Thomas

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to