Could be because the xml tags are case sensitive.
I tried the following with your xml and it worked...
<html>
<head>
<script type="text/javascript">
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","cd.xml",false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;
x=xmlDoc.getElementsByTagName("cd");
i=0;
function displayCD()
{
document.getElementById("to").innerHTML=
xmlDoc.getElementsByTagName("title")[0].childNodes[0].nodeValue;
}
</script>
</head>
<body onload="displayCD()">
<div>
<b>Title:</b> <span id="to"></span><br />
<b>Artist:</b> <span id="from"></span><br />
<b>Country:</b> <span id="message"></span>
</div>
<div id='showCD'></div>
</body>
</html>
iamthwee
Posting Genius
6,254 posts since Aug 2005
Reputation Points: 1,567
Solved Threads: 476
Skill Endorsements: 34
I used the same xml file as you. I just renamed it to cd.xml
iamthwee
Posting Genius
6,254 posts since Aug 2005
Reputation Points: 1,567
Solved Threads: 476
Skill Endorsements: 34
Yeah I just realised that too...
Something must be wrong with the code because it should work for all browsers, let me check.
iamthwee
Posting Genius
6,254 posts since Aug 2005
Reputation Points: 1,567
Solved Threads: 476
Skill Endorsements: 34
iamthwee
Posting Genius
6,254 posts since Aug 2005
Reputation Points: 1,567
Solved Threads: 476
Skill Endorsements: 34