<script language="javascript">
var xmlHttp;
//判断浏览器类型
function createXMLHttpRequest(){
if(window.ActiveXObject)
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
else if(window.XMLHttpRequest)
xmlHttp = new XMLHttpRequest();
}
//发送GET请求,并接收数据
function startRequest(){
createXMLHttpRequest();
xmlHttp.open("GET","2.html",true);
xmlHttp.onreadystatechange = function(){
if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
document.getElementById("target").innerHTML = xmlHttp.responseText;
}
xmlHttp.send(null);
}
</script>
</head>
<body>
<input type="button" value="异步测试" onClick="startRequest()">
<br /><br />
<div id="target"></div>
该类型相比jquery方法确实复杂了不少。。。
http://blog.csdn.net/huoshi5151/article/details/8540326