Thursday, June 28, 2012

Re: Loading third-party Javascript with a script loader

Hi,

You can add javascript asynchronously whenever you want and invoke any function from that js using JSNI.

Please refer following 

You will probably need something like following to add js in the page and then you can invoke the method from your js using JSNI

public void addScript(String url) {      Element e = DOM.createElement("script");      DOM.setAttribute(e, "language", "JavaScript");      DOM.setAttribute(e, "src", url);      DOM.appendChild(RootPanel.get().getElement(), e);  } 

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/raYYrIyZ4aMJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment