【www.bbyears.com--php函数】
test
<script>
function createAjax() { //该函数将返回XMLHTTP对象实例
var _xmlhttp;
try {
_xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); //IE的创建方式
}
catch (e) {
try {
_xmlhttp=new XMLHttpRequest(); //FF等浏览器的创建方式
}
catch (e) {
_xmlhttp=false; //如果创建失败,将返回false
}
}
return _xmlhttp; //返回xmlhttp对象实例
}
var exitdos =createAjax();
alert(exitdos)
exitdos.open("GET","www.111cn.net",true);
exitdos.onreadystatechange= function()
{
if (exitdos.readyState == 1) {document.getElementById("b").innerHTML="check..."}
if(exitdos.readyState==4)
{
//( == 200) &&
alert(exitdos.status)
alert(exitdos.responseText);
}
}
exitdos.send(null);
</script>