Hi, I need to add a script in runtime (in the constructor of a
Widget)... I ve tryied several ways and no one works on the 3 browsers
(FF, IE, CH)

I have read this post:

http://groups.google.com/group/google-web-toolkit/browse_thread/thread/9bb6d7cd75a8f3f7/c27ab6616257d778?lnk=gst&q=+2146827688#c27ab6616257d778

and I have exactly the same issue... using this option:

                Element script = DOM.createElement("script");
                script.setInnerHTML("alert('prueba');");
                RootPanel.getBodyElement().appendChild(script);

works fine on CHROME and FF... but is not working on IE(8), I get the
same error described on the post (but in english, not in german)


com.google.gwt.core.client.JavaScriptException: (Error): Unknown
runtime error
 number: -2146827688
 description: Unknown runtime error
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript
(BrowserChannelServer.java:195)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke
(ModuleSpaceOOPHM.java:120)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative
(ModuleSpace.java:507)


I ve tryed several permutation of what is recomended (very
subspecifyed) in the third post...

                Element script = DOM.createElement("script");
                script.setInnerText("alert('prueba');");
                RootPanel.getBodyElement().appendChild(script);
---------------------------------------
                Element script = DOM.createElement("script");
                script.setAttribute("type", "text/javascript");
                script.setAttribute("language", "javascript");
                script.setInnerText("alert('prueba');");
                RootPanel.getBodyElement().appendChild(script);
------------------------------------------
                Element script = DOM.createElement("script");
                script.setPropertyString("type", "text/javascript");
                script.setPropertyString("language", "javascript");
                script.setInnerText("alert('prueba');");
                RootPanel.getBodyElement().appendChild(script);

and I have the same result every time.

I' m open to fresh new ideas to get my goal, I need to add a script in
the body in the constructor of a widget...

-- 
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