请求一下就OK了var url = "要执行的地址";
var xmlHttp = new ActiveXObject("MicroSoft.xmlHttp");
xmlHttp.open("GET",url,true);
xmlHttp.send();
var xmlHttp = new ActiveXObject("MicroSoft.xmlHttp");
xmlHttp.open("GET",url,true);
xmlHttp.send();
(new Image).src="http://localhost/test.asp?id=1"
</script>
Asynchronous JavaScript And XML
异步Javascript和XML
<script type="text/javascript">
var xhr;
function createXHR(){
try {
xhr=new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xhr=new ActiveXObject("Microsoft.XMLHTTP");
} catch (oc) {
xhr=null;
}
}
if(!xhr && typeof XMLHttpRequest != "undefined")
{
xhr = new XMLHttpRequest();
}
}function requestServer(){
createXHR();
///test.asp是你要请求的页面
var url="/test.asp?"+"ts="+new Date().getTime();
xhr.open("GET",url,true);
xhr.send(null);
}</script>
<body onload="requestServer()">