rgbtdkjcel 发表于 2007-9-4 13:51

ajax中的回调函数

在ajax中。。通过onreadystatechang来调用回调函数! 那为什么这个回调函只会执行一次呢??例如:<BR>  xmlhttp.onreadystatechang=dd;<BR>  <BR> function dd(){<BR>  alert("abcd");---------------- 测试<BR><BR> if (xmlhttp.readystate==4){<BR>   if(xmlhttp.status==200){<BR>   alert(xmlhttp.responseText);<BR>}<BR>   else{<BR>  alert("不正常");<BR>}<BR>}<BR>}<BR>我在第一个if语句前随便加入一个弹出语句alert("abcd");<BR><BR>为什么我的alert("abcd")只会执行一次呢???<BR>  <BR>


页: [1]

编程论坛