zoukankan      html  css  js  c++  java
  • 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);    
        }      
    }  
  • 相关阅读:
    防火墙透明模式
    HP管理工具System Management Homepage安装配置
    kbmmw 中JSON 中使用SQL 查询
    kbmmw 中JSON 操作入门
    第一个kbmmw for Linux 服务器
    kbmmw 5.02发布
    kbmmw 5.01 发布
    使用delphi 10.2 开发linux 上的Daemon
    使用unidac 在linux 上无驱动直接访问MS SQL SERVER
    使用delphi 10.2 开发linux 上的webservice
  • 原文地址:https://www.cnblogs.com/wulihong/p/8950448.html
Copyright © 2011-2022 走看看