XMLHttpRequest Post请求

ie下正常返回结果,ff下无法获取跨域结果

 

var XMLHttpReq =  new XMLHttpRequest();
      XMLHttpReq.open("POST", "http://10.96.3.120/app/Service.asmx/getSysTime", true);
    content="";
    XMLHttpReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");//x-www-form-urlencoded
     XMLHttpReq.setRequestHeader("Content-Length", content.length);
    XMLHttpReq.onreadystatechange = function() {
        if (XMLHttpReq.readyState == 4) {
            if (XMLHttpReq.status == 200) {
                alert(XMLHttpReq.responseText);
            }
            else{
            //alert(XMLHttpReq.status);
            //alert(XMLHttpReq.responseText);
            }
        }else{
            alert(XMLHttpReq.readyState);
        }
    }
    XMLHttpReq.send(null);

你可能感兴趣的:(IE)