Quantcast
Channel: Internet Explorer Web Development forum
Viewing all articles
Browse latest Browse all 3527

xml embedded in html in IE9

$
0
0

Hi,

 

In our application we have xml dynamically embedded in html(“data islands”).

If later in code  I try get the content of xml using XMLDocument property

 (the code is document.getElementById(“some id”). XMLDocument),

I get exception because this property in IE9 is undefined, but in previous version of IE it works.

Below you can find sample that you can execute and recreate the problem(you can change the compitability mode to 8 to see the example retreive data)

 

Thanks,

Polina

<html>

<meta http-equiv="Content-Type" Content="text/html; CHARSET=utf-8">

                <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">

                <meta http-equiv="X-UA-Compatible" content="IE=9">

                <LINK REL="SHORTCUT ICON" HREF="images/MainSite.ico">

                <TITLE>Astea Alliance Enterprise</TITLE>

<head>

</head>

<body>

<script type="text/javascript">

       

     function _onClick()

          {

                var str = "<xml id='workerxml0' name='workerxml0'><node>aaa</node></xml>";

                 document.body.insertAdjacentHTML("afterBegin",str);

                alert("typeof workerxml0.XMLDocument " + typeof(workerxml0.XMLDocument));

                alert("workerxml0.XMLDocument.xml " + workerxml0.XMLDocument.xml);

         }

</script>

</body>

<button name="btn" onclick='_onClick();'>click</button>

</html>


Viewing all articles
Browse latest Browse all 3527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>