J
Jeremy
I'm using innerHTML as a fall-back for IE when grabbing a remote HTML
fragment via XmlHttpRequest (since IE doesn't have importNode capability).
I create an element, like this:
var container = document.createElement("div");
someElement.appendChild(container);
Then, in the callback for the XmlHttpRequest, I do this:
container.innerHTML = "test";
At this point, I.E. throws an "Unknown runtime error".
Interestingly, if I change that "div" to a "span", it works - as long as
the "test" string contains no markup ("div" fails no matter what).
Additionally, if I try setting the innerHTML of an element that was
already there when the page loaded (as opposed to created with
createElement), that also works.
Is this a documented problem, or should I give up on taking the lazy
route and just walk the DOM of the responseXML to get the HTML fragment
to go into the container? I try to avoid recursion in javascript
wherever possible, but maybe this is not such a case.
Thanks,
Jeremy
fragment via XmlHttpRequest (since IE doesn't have importNode capability).
I create an element, like this:
var container = document.createElement("div");
someElement.appendChild(container);
Then, in the callback for the XmlHttpRequest, I do this:
container.innerHTML = "test";
At this point, I.E. throws an "Unknown runtime error".
Interestingly, if I change that "div" to a "span", it works - as long as
the "test" string contains no markup ("div" fails no matter what).
Additionally, if I try setting the innerHTML of an element that was
already there when the page loaded (as opposed to created with
createElement), that also works.
Is this a documented problem, or should I give up on taking the lazy
route and just walk the DOM of the responseXML to get the HTML fragment
to go into the container? I try to avoid recursion in javascript
wherever possible, but maybe this is not such a case.
Thanks,
Jeremy