sbl2255 发表于 2013-1-29 11:32:58

Ajax XMLHttpRequest

习惯了jQuery之后,怎么写XMLHttpRequest都快忘了,真够晕的....

var xmlhttp;function getxmlhttp(){try{xmlhttp = new XMLHttpRequest();}catch(faild){try{xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");}catch(faild){try{xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");}catch(faild){xmlhttp=false;}}}}xmlhttp.onreadystatechange=updatePage();function updatePage() {   if (request.readyState == 4)   if (request.status == 200)       alert("Server is done!");
页: [1]
查看完整版本: Ajax XMLHttpRequest