AJAX源码

<script  type="text/javascript">
            function btnClick()
            {
                var xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
                if(!xmlHttp)
                {
                    alert("创建XMLHTTP对象出错");
                    return false;
                }
                xmlHttp.open("Post","AjaxHandler.ashx?ts"+new date(),false);
                xmlHttp.onreadystatechange=function()
                {
                    if(xmlHttp.readyState==4){
                        if(xmlHttp.status==200){
                            document.getElementById("Text1").value=xmlHttp.responseText;
                        }
                        else {
                            alert("AJAX返回值错误");
                        }
                    }
                }
                xmlHttp.send();
            }
    </script>
原文地址:https://www.cnblogs.com/juexin/p/2941310.html