0

I'm trying to create new Window with GWT as it shown here: https://stackoverflow.com/a/4205058/898588

This works in FF, Chrome, but doesn't work in IE (IE9 in my case). I see exception in dev. mode:

(null): DOM Exception: HIERARCHY_REQUEST_ERR (3)

So, this string:

bdElement.getOwnerDocument().getElementById("mainbody").appendChild(config.getElement());

throws this exception.

I've tried:

bdElement.appendChild(config.getElement());

but it was unsuccessfully.

How to make it work in IE?

Community
  • 1
  • 1
CHEM_Eugene
  • 438
  • 3
  • 20

2 Answers2

0

Solution was found:

bdElement.getFirstChildElement().setInnerHTML(config.getElement().getString());

This works in IE, Opera, Chrome, FF

CHEM_Eugene
  • 438
  • 3
  • 20
0

To be more specific, you only need to use setInnerHTML() instead of appendChild(), so the following piece of code will work as well in IE9 and Chrome as far as I can tell:

bdElement.getOwnerDocument().getElementById("mainbody").setInnerHTML(config.getElement().getString());
rukbotto
  • 51
  • 3