<script type="text/javascript">
if (window.XMLHttpRequest)
xmlhttp=new XMLHttpRequest();
else if (window.ActiveXObject)
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("GET",url,false);
document.getElementById('A1').innerHTML=xmlhttp.status;
document.getElementById('A2').innerHTML=xmlhttp.statusText;
document.getElementById('A3').innerHTML=xmlhttp.responseText;
alert("Your browser does not support XMLHTTP.");
<h2>Using the HttpRequest Object</h2>
<br /><span id="A3"></span>
<button onclick="loadXMLDoc('/example/xdom/note.xml')">Get XML</button>