当我试图做一个HTTP请求到服务器,我收到在Internet Explorer下面的网络错误,它会错误回调函数:获取网络错误
SCRIPT7002: XMLHttpRequest: Network Error 0x2ef3, Could not complete the operation due to error 00002ef3
和在Chrome和Firefox它会错误回调函数,并显示以下错误:
XMLHttpRequest cannot load the url. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
下面是代码:
HTTPRequestConts.GET_NAV = https://abc.xyz.com:8090/autoregisterbymobileno?id=ODgyODAyMDMzNg;;&cver=ios_3.0.1&dev=QTMzNkZCQUEtREVEQy00RUE4LTlDQTYtMjg0RDk0QkIyRDRB&lv=0&imei=MzUzMjg1MDcyNjY2ODQxMA;;&oem=100001&dm=QXBwbGU;&osv=aU9TMTAuMC4y";
var c = new HTTPRequest(HTTPRequestConts.GET_NAV);
c.setRequestMethod(HTTPRequestConts.GET), c.setCINResponseParser(),
c.setCallback(new NavProxyCallback({
onSuccess: function onSuccess(response) { console.log('success' + JSON.stringify(response)); },
onError: function onError(err) {
console.log('failure' + JSON.stringify(err)); }}, false)),
HTTPClient.getInstance().send(c);
http://stackoverflow.com/questions/20035101/no-access-control-allow-origin-header-is-present-on-the-requested-resource – soorapadman
请将你正在尝试执行的代码添加到问题,以便您可以轻松帮助。 –