var xmlHttpRequest;
function createXmlHttpRequest()
{
if(window.ActiveXObject)
{
xmlHttpRequest =new ActiveXObject("Microsoft.XMLHTTP");
}
else
{
xmlHttpRequest = new XMLHttpRequest();
}
}
function sendMessage()
{
createXmlHttpRequest();
var url="MyHtml3.html";
xmlHttpRequest.open("GET",url,true);
xmlHttpRequest.onreadystatechange=callBack;
xmlHttpRequest.send();
}
function callBack()
{
alert('a');
}
测试成功了 |