[Script]
Script Syntax
oXMLHttpRequest.onreadystatechange = funcMyHandler;
Example
The following script example specifies the handler HandleStateChange gets called when an IXMLHTTPRequest object's readyState property changes. A button on a page is enabled when the readyState property indicates that all data has been received (readystate == 4).
<script>
var xmlhttp=null;
function PostOrder(xmldoc)
{
var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.4.0");
xmlhttp.Open("POST", "http://myserver/orders/processorder.asp", false);
xmlhttp.onreadystatechange= HandleStateChange;
xmlhttp.Send(xmldoc);
myButton.disabled = true;
}
function HandleStateChange()
{
if (xmlhttp.readyState == 4)
{
myButton.disabled = false;
alert("Result = " + xmlhttp.responseXML.xml);
}
}
</script>
In Microsoft Visual Basic® Scripting Edition (VBScript), you can get a function pointer using the syntax getRef("HandleStateChange").