IE (7&8) don't work well with setInnerHTML. The same calls that work
find with FireFox and other browsers fail for IE. I've got some HTML
that is sent from the server and must be inserted into an element.
setInnerHTML always works for FF. On IE, I need to know when
setInnerHTML will fail, and what alternatives are available.
This is the only example (trying to make it short) I've seen working
for IE.
String innerHTML = sentFromServer();
HTMLPanel htmlPanel = new HTMLPanel("");
htmlPanel.getElement().setInnerHTML(innerHTML);
center();
show();
If you take something similar and put it in the UiBinder it fails.
In example.ui.xml ...
<HTMLPanel ui:field="htmlPanel"></HTMLPanel>
In example.java
@UiField HTMLPanel htmlPanel;
:
:
standard init and bind stuff above.
String innerHTML = sentFromServer();
htmlPanel.getElement().setInnerHTML(innerHTML);
----
This fails in hosted mode with a:
00:54:24.933 [ERROR] Uncaught exception escaped
com.google.gwt.core.client.JavaScriptException: (Error): Unknown
runtime error number: -2146827687 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)
Any recommendations on dealing with IE and setInnerHTML? What is a
workaround? What is the best way to deal with this?
--
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.