<script lanuage = "javaScript">
//创建对象
function createXMLHttpRequest(){
if(window.ActiveXObject){
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else if(window.XMLHttpRequest){
xmlHttp = new XMLHttpRequest();
}
}
//前台界面事件调用的函数
function checkName(){
createXMLHttpRequest();
xmlHttp.onreadystatechange = handleStateChange;
var sql = "UserReg.aspx?";
xmlHttp.open("GET",sql,true);
xmlHttp.send(null);
}
//和服务器交互期间执行的函数
function handleStateChange(){
if(xmlHttp.readyState == 4){
if(xmlHttp.status == 200){
document.getElementById("divx").innerHTML = xmlHttp.responseText;
}
}
}
<script>
posted on 2009-04-28 07:53
Werther 阅读(434)
评论(1) 编辑 收藏 所属分类:
13.AJAX