<html><head></head>
<script language="javascript">
var xmlHttp;
function createXMLHttpRequest(){
if(window.ActiveXObject)
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
else if (window.XMLHttpRequest)
xmlHttp=new XMLHttpRequest();
}
function startRequest(){
createXMLHttpRequest();
xmlHttp.open("GET","9-1.aspx",true);
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState==4&&xmlHttp.status==200)
alert("服务器返回:"+xmlHttp.responseText);
xmlHttp.send(null);}
</script>
<body>
<input type="button" value="测试异步通讯" onClick="startRequest()"/>
</body></html>
<script language="javascript">
var xmlHttp;
function createXMLHttpRequest(){
if(window.ActiveXObject)
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
else if (window.XMLHttpRequest)
xmlHttp=new XMLHttpRequest();
}
function startRequest(){
createXMLHttpRequest();
xmlHttp.open("GET","9-1.aspx",true);
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState==4&&xmlHttp.status==200)
alert("服务器返回:"+xmlHttp.responseText);
xmlHttp.send(null);}
</script>
<body>
<input type="button" value="测试异步通讯" onClick="startRequest()"/>
</body></html>
createXMLHttpRequest();
xmlHttp.open("GET","9-1.aspx",true);
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState==4&&xmlHttp.status==200)
alert("服务器返回:"+xmlHttp.responseText);
}
xmlHttp.send(null);
}