ie7ajax 跨域 no transport 解决办法
生活随笔
收集整理的这篇文章主要介绍了
ie7ajax 跨域 no transport 解决办法
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
客户端js
<script src="jquery-1.8.0.min.js"></script> <script src="JavaScript1.js"></script><script src="jquery.cookie.js"></script><script> $(function(){ jQuery.support.cors = true; if (!$.cookie('MyCookie')) {$.cookie('MyCookie', "userid%3D1111");}//$.cookie('Zbb', "userid%3D123");var MyCookie = decodeURIComponent($.cookie('MyCookie'));var UserID = MyCookie.substr(MyCookie.indexOf("=") + 1); onLogin("Get", 'http://11.11.152.225:8084/api/tbl_Task_Dispatch/GetDispatchList?userID='+UserID , zswFun);}) JavaScript1.js //XmlHttpRequest对象 function createXmlHttpRequest(){ if(window.ActiveXObject){ //如果是IE浏览器 return new ActiveXObject("Microsoft.XMLHTTP"); }else if(window.XMLHttpRequest){ //非IE浏览器 return new XMLHttpRequest(); } } function onLogin(metched,url,zswFun){ //userName = document.f1.username.value; //passWord = document.f1.password.value; //url = "http://11.11.152.225:8084/api/tbl_Task_Dispatch/GetDispatchList?userID=90016"; //1.创建XMLHttpRequest组建 xmlHttpRequest = createXmlHttpRequest(); //2.设置回调函数 xmlHttpRequest.onreadystatechange = zswFun; //3.初始化XMLHttpRequest组建 xmlHttpRequest.open(metched,url,true); //4.发送请求 xmlHttpRequest.send(null); } //回调函数 function zswFun(){ if(xmlHttpRequest.readyState == 4 && xmlHttpRequest.status == 200){ var b = xmlHttpRequest.responseText; var data=$.parseJSON(b);$("#WaitHandlerCount").text(data.total); } }
转载于:https://www.cnblogs.com/wulihong/p/8950448.html
总结
以上是生活随笔为你收集整理的ie7ajax 跨域 no transport 解决办法的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: bzoj 1699: [Usaco200
- 下一篇: Aop和Filter区别