I'm just starting to learn javascript and trying to read in an XML document.
But something must be wrong.. I dont think the file is reading?
The xml document I have is called testXmlDoc and is located in the same folder as my html doc.
Any ideas?
Thanks.
<html>
<body>
<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","testXmlDoc.xml",false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;
document.write("test text");
</script>
</body>
</html>

New Topic/Question
Reply



MultiQuote




|