Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: appendChild & cloneNode

From: David Mark <dmark.cinsoft@-----.--->
To: NULL
Date: 6/1/2009 2:50:00 PM
On Jun 1, 5:35=A0pm, Chameleon <cham_...@hotmail.com> wrote:
> The following code display a DIV#help with AJAX loaded XML inside.
> It works fine in W3C Compliant Browsers but not in IE8.
> The problem in IE8 appears in last line.
> Is there an error in my code or an IE8 incompatibility?
> Any workarounds?
> Thanks
> ---------------------------------------------------------
> function openHelp(a) {
> =A0 =A0 =A0 =A0 var obj =3D document.getElementById('help');
> =A0 =A0 =A0 =A0 obj.style.display =3D 'block';
>
> =A0 =A0 =A0 =A0 var xmlHttp =3D new XMLHttpRequest();
> =A0 =A0 =A0 =A0 xmlHttp.onreadystatechange =3D function() {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (xmlHttp.readyState =3D=3D 4)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 innerDOM(obj, xmlHttp.res=
ponseXML.documentElement);
> =A0 =A0 =A0 =A0 }
> =A0 =A0 =A0 =A0 xmlHttp.open("GET", 'help.php/' + a, true);
> =A0 =A0 =A0 =A0 xmlHttp.send(null);
>
> }
>
> function innerDOM(where, root) {
> =A0 =A0 =A0 =A0 for (var z =3D 0; z < root.childNodes.length; z++)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 where.appendChild(root.childNodes[z].clon=
eNode(true)); =A0// <-- HERE IS
> THE PROBLEM}
>
> --------------------------------------------------------------

It takes a lot more than that to import XML nodes into an HTML DOM.
It is especially tricky in IE.  I suggest you use innerHTML or find
another approach (e.g. download data instead of markup.)


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent