ie7ajax 跨域 no transport 解决办法
生活随笔
收集整理的這篇文章主要介紹了
ie7ajax 跨域 no transport 解决办法
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
客戶端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.創(chuàng)建XMLHttpRequest組建 xmlHttpRequest = createXmlHttpRequest(); //2.設(shè)置回調(diào)函數(shù) xmlHttpRequest.onreadystatechange = zswFun; //3.初始化XMLHttpRequest組建 xmlHttpRequest.open(metched,url,true); //4.發(fā)送請求 xmlHttpRequest.send(null); } //回調(diào)函數(shù) function zswFun(){ if(xmlHttpRequest.readyState == 4 && xmlHttpRequest.status == 200){ var b = xmlHttpRequest.responseText; var data=$.parseJSON(b);$("#WaitHandlerCount").text(data.total); } }?
轉(zhuǎn)載于:https://www.cnblogs.com/wulihong/p/8950448.html
總結(jié)
以上是生活随笔為你收集整理的ie7ajax 跨域 no transport 解决办法的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: bzoj 1699: [Usaco200
- 下一篇: Aop和Filter区别