ajax 流程

来源:互联网 发布:java 进阶书籍 编辑:程序博客网 时间:2024/05/21 06:47

 var xhr = new .XMLHttp Request;

xhr.open ("post","地址",定义是否异步);

请求头: xhr.setrequestHeader ("content-type","application/x-www-form-urlencoded");

XMLHttpRequestabort();

传递格式字符串。给ajax传数据。

例如:var data=“username=”+use.value+"password"+pass.value;

xhr.send(data);

xhr..onreadstatechange =function(){

            if (xhr ready state==40{

             xhr:responseText;}

}

0 0