Chrome and IE do not show tag values from XML file

PEAFLENTLEAGS

New Member
I have following HTML code:\[code\]<html><body><h1>W3Schools Internal Note</h1><div> <b>To:</b> <span id="to"></span><br /><b>From:</b> <span id="from"></span><br /><b>Message:</b> <span id="message"></span></div><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","languages.xml",false);xmlhttp.send();xmlDoc=xmlhttp.responseXML;document.getElementById("to").innerHTML= xmlDoc.getElementsByTagName("to")[0].childNodes[0].nodeValue;document.getElementById("from").innerHTML=xmlDoc.getElementsByTagName("from")[0].childNodes[0].nodeValue;document.getElementById("message").innerHTML=xmlDoc.getElementsByTagName("body")[0].childNodes[0].nodeValue;</script></body></html>\[/code\]This code works in Firefox but not working in Chrome and IE. I mean Firefox shows the results of XML tags from XML document but Chrome and IE are not!!!Please help me out.
 
Back
Top