AJAX 请求经典过程

1.post

   var xhr = new XMLHttpRequest();
   xhr.open('post',"OfficeToolType.ashx?cmd=list", true);
   xhr.setRequestHeader("Content-type","application/x-www-    form-urlencoded");
   xhr.onreadystatechange = function ()
  {
        if (xhr.readyState == 4 && xhr.status == 200)
       {
        alert(xhr.responseText);
       }
   }
 xhr.send(null);

 

posted on 2013-05-15 17:40  六欲  阅读(161)  评论(0)    收藏  举报

导航