您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

ajax异步请求post方式

2024/2/22 5:43:00发布14次查看
<script> //创建浏览器对象 function createxhr(){ //判定浏览器类型处理第一种方法 /* var xhr; var str=window.navigator.useragent; if(str.indexof('msie')>0){ xhr=new activexobject('microsoft.xmlhttp'); }else{ xhr=new xmlhttprequest(); } return xhr; */ try{ return new activexobject('microsoft.xmlhttp'); }catch(e){ } try{ return new xmlhttprequest(); }catch(e){ } }; //ajax post请求 var data="username=zs&&password=123456"; var xhr=createxhr(); xhr.onreadystatechange=function(){ if(xhr.readystate==4&&xhr.status==200){ }; } xhr.open("post","/ajaxpost1"); xhr.setrequestheader('content-type','application/x-www-form-urlencoded') xhr.send(data); </script>
以上就是ajax异步请求post方式的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product