【ajax检测用户名是否存在】ajax检测用户名

更新时间:2015-01-08    来源:php函数    手机版     字体:

【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>

本文来源:http://www.bbyears.com/jiaocheng/12053.html

猜你感兴趣