In聽Mozilla,聽Firefox,聽Safari,聽and聽Netscape,聽you聽create聽an聽instance聽of聽the聽XMLHttpRequest聽object
by聽doing聽the聽following:
<script>var聽xhr聽=聽new聽XMLHttpRequest();</script>
For聽Internet聽Explorer:
<script>聽var聽xhr聽=聽new聽ActiveXObject("Microsoft.XMLHTTP");</script>
Here聽is聽an聽example聽of聽using聽the聽XMLHttpRequest聽object:
<script>
var聽xhr聽=聽null;
if聽(window.XMLHttpRequest){
xhr聽=聽new聽XMLHttpRequest();
}聽else聽{
xhr聽=聽new聽ActiveXObject("Microsoft.XMLHTTP");
}
if聽(xhr)聽{
var聽url聽=聽"/someURI";
xhr.onreadystatechange聽=聽xhrCallback;
xhr.open("get",聽url,聽true)
xhr.send()
}
function聽xhrCallback()聽{
if聽(xhr.readyState聽==聽4)聽{
if聽(xhr.status聽==聽200)聽{
alert("Ok");
}聽else聽{
alert("Problem聽retrieving聽Ajax聽response");
}
}
}
</script>

]]>