Ajax

 1 function Ajax() {
 2     var xmlHttpReq = new XMLHttpRequest();
 3     xmlHttpReq.open("GET", "test.ashx", true);
 4     xmlHttpReq.onreadystatechange = RequestCallBack;
 5     xmlHttpReq.send(null);
 6 
 7     function RequestCallBack() {
 8         if (xmlHttpReq.readyState == 4) {
 9             if (xmlHttpReq.status == 200) {
10                 document.write(xmlHttpReq.responseText);
11             }
12         }
13     }
14 }
  1.  get :  Params,QueryString
     post: Params,Form
  2.  serialize(): 按name序列化
posted @ 2012-12-13 17:09  David Huang  阅读(141)  评论(0编辑  收藏  举报