23wldayin
新手上路

UID 94625
精华
0
积分 23
帖子 11
金钱 23 喜悦币
威望 0
人脉 0
阅读权限 10
注册 2007-6-28
状态 离线
|
简单的Ajax问题,求助!!!!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD
XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtm11/DTD/xhtml-strict.dtd">
<html xmlns="http://www.w3c.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Simple</title></title>
<script type="text/javascript">
var xmlHttp;
function createXMLHttpRequest(){
if(window.ActiveXObject){
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}else if(window.xmlHttpRequest){
xmlHttp=new XMLHttpRequest();
}
return xmlHttp;
}
function startRequest(){
createXMLHttpRequest();
xmlHttp.onreadystatechange=handleStateChange;
xmlHttp.open("GET","simpleResponse.xml",true);
xmlHttp.send(null);
}
function handleStateChange(){
if(xmlHttp.readyState==4){
if(xmlHttp.status==200){
alert("The server replied with:"+xmlHttp.responseText)
}
}
}
</script>
</head>
<body>
<form action="#">
<input type="button" value="Start Basic Asynchronous Request" onClick="startRequest();"/>
</form>
</body>
</html>
上面是我在调试的Ajax代码,初学不会,请高手指教一二.
其运行时应该弹出一个"警告"对话框,可我运行时却没有.
|
|