I am using an external javascript (for gwt-OpenLayers specifically)
and currently have this being included in my host page by adding

<script src="http://openlayers.org/api/2.8/OpenLayers.js";></script>

This script is quite large and I would like to load this in a separate
split point. I have tried adding the script node dynamically inside
the onSuccess method

        GWT.runAsync(new RunAsyncCallback() {

                public void onSuccess() {
                    Element node= DOM.createElement("script");
                    node.setAttribute("src", "http://openlayers.org/api/2.8/
OpenLayers.js");
                    RootPanel.getBodyElement().append(node);

                   //Code requiring that OpenLayers.js be loaded

Using Firebug it looks like the node is being added to the DOM unlike
the other method there is no guarantee that the script is loaded
before the onModuleLoad is called so the script isn't loaded yet. Any
sugesstions?
-- 
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