Hi everyone, I am trying to access an online XML file, for example: http://www.rgraph.net/sample.xml using HTML.

Code:
<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");
}

var url = "http://www.rgraph.net/sample.xml";
xmlhttp.open("GET",url,false); //If url is replaced by the downloaded file named "sample.xml" this works and give the output of 1.
// but works only on Mozilla
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;

var x=xmlDoc.getElementsByTagName("stats");
alert(x.length);

</script>

</body>
</html>
Any comment or advice would be much appreciated!

PS: Why does this only work on Mozilla and NOT on Safari or Chrome?

Many thanks!