Hello!
What I'm trying to do is load an XML file from someone else's server and use the information in that file to display on my website. I wrote the following code which works great on my desktop, but when I upload the file, no go ;(
I've also noticed that the ondatasetcomplete event doesn't seem to fire when I upload the file to my website. But I used onreadystatechange instead, so that's not a big deal. So the only real question is, is this like IFrames where you're denied access from the DOM of pages loaded in an IFrame if they are located in a different domain, or is the way I'm loading this XML file not acceptable? It seems like a pretty cheap way to do it because I'm avoiding Ajax altogether, but it was the easiest! Also, I do have access to Perl, but when I tried using LWP to load the XML file and specifying the content-type as text/xml, it wouldn't work - I got some sort of "instructions not closed" error or something. Anyway, any help you could offer would be great!!
What I'm trying to do is load an XML file from someone else's server and use the information in that file to display on my website. I wrote the following code which works great on my desktop, but when I upload the file, no go ;(
Code:
<script>
<!--
function checkState() {
var mainNode = XMLSrc.selectSingleNode("//firstNode/secondNode");
var info = mainNode.getAttributeNode("info").text;
}
//-->
</script>
<xml id="XMLSrc" src="[URL unfurl="true"]http://www.someserver.com/somexmlfile.xml"[/URL] ondatasetcomplete="checkState();"></xml>