<script type="text/javascript">
if (window.XMLHttpRequest)
xmlhttp=new XMLHttpRequest();
else if (window.ActiveXObject)
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.onreadystatechange=state_Change;
xmlhttp.open("GET",url,true);
alert("Your browser does not support XMLHTTP.");
if (xmlhttp.readyState==4)
document.getElementById('A1').innerHTML=xmlhttp.status;
document.getElementById('A2').innerHTML=xmlhttp.statusText;
document.getElementById('A3').innerHTML=xmlhttp.responseText;
alert("Problem retrieving XML data:" + xmlhttp.statusText);
<h2>Using the HttpRequest Object</h2>