C
Chuck Wyatt
I've got the following code below that relies upon an ActiveX object
and a xmlDoc.load() function that works great in Internet Explorer.
I'm interested in using XML in order to load a data structure from a
remote location, and this code does it, but of course does not work in
Netscape. Is there a method of loading a remote XML doc that works in
the latest versions of NS?
Thanks,
Chuck
~~~~~~~~~ Code Example Below ~~~~~~~~
<script type="text/javascript"
for="window" event="onload">
var xmlDoc=new ActiveXObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDoc.load("http://www.blahblahblah.com/xml/xml_note.xml")
nodes=xmlDoc.documentElement.childNodes
to.innerText= nodes.item(0).text
from.innerText= nodes.item(1).text
header.innerText=nodes.item(2).text
body.innerText= nodes.item(3).text
</script>
<title>HTML using XML data</title>
</head>
<body bgcolor="yellow">
<h1>Blahblahblah.com Internal Note</h1>
<b>To: </b>
<span id="to"> </span>
<br />
<b>From: </b>
<span id="from"></span>
<hr>
<b><span id="header"></span></b>
<hr>
<span id="body"></span>
and a xmlDoc.load() function that works great in Internet Explorer.
I'm interested in using XML in order to load a data structure from a
remote location, and this code does it, but of course does not work in
Netscape. Is there a method of loading a remote XML doc that works in
the latest versions of NS?
Thanks,
Chuck
~~~~~~~~~ Code Example Below ~~~~~~~~
<script type="text/javascript"
for="window" event="onload">
var xmlDoc=new ActiveXObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDoc.load("http://www.blahblahblah.com/xml/xml_note.xml")
nodes=xmlDoc.documentElement.childNodes
to.innerText= nodes.item(0).text
from.innerText= nodes.item(1).text
header.innerText=nodes.item(2).text
body.innerText= nodes.item(3).text
</script>
<title>HTML using XML data</title>
</head>
<body bgcolor="yellow">
<h1>Blahblahblah.com Internal Note</h1>
<b>To: </b>
<span id="to"> </span>
<br />
<b>From: </b>
<span id="from"></span>
<hr>
<b><span id="header"></span></b>
<hr>
<span id="body"></span>