load XML from an external domain - How to

wxdqz

New Member
Hey...

I try to load an external XML file from server <!-- w --><a class="postlink" href="http://www.aaa.com">www.aaa.com</a><!-- w --> via JavaScript into a file on <!-- w --><a class="postlink" href="http://www.bbb.com">www.bbb.com</a><!-- w -->. Unfortunately this has to be since the server from <!-- w --><a class="postlink" href="http://www.aaa.com">www.aaa.com</a><!-- w --> does not support php with which I am edditing the xml file.

Please help!

Here is the code it isn't working with:

<html>
<head>
<script
type="text/javascript"
for="window"
event="onload">

var xmlDoc=new ActiveXObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDoc.load("http://www.aaa.com/test.xml")

nodes=xmlDoc.documentElement.childNodes
a1.innerText=nodes.item(0).text
a2.innerText=nodes.item(1).text
a3.innerText=nodes.item(2).text
a4.innerText=nodes.item(3).text

</script>
</head>

<body bgcolor="yellow">

<h1>W3Schools Internal Note</h1>

<b>To:</b>
<span id="a1"></span>
<br />

<b>From:</b>
<span id="a2"></span>
<hr />

<b><span id="a3"></span></b>

<hr />
<span id="a4"></span>

</body>
</html>

Thanks
 
Top