【问题标题】:DNN Ajax IE ErrorDNN Ajax IE 错误
【发布时间】:2013-08-01 23:34:02
【问题描述】:

我正在尝试创建一个 Dotnetnuke 模块,该模块将从 Web Api 服务获取数据,并且我试图从我的模块中访问它,它在 ajax 调用中但仅在 IE 中出现错误(访问被拒绝)。在 Firefox 中它可以完美运行。如果它不在 Dotnetnuke 中,它可以在 Firefox 或 IE 中运行。这是我遇到问题的 ajax:

var Rep = (function () { 
  var json = null; 

$.support.cors = true; 

$.ajax({ 
type: "GET", 
async: false, 
global: false, 
url: "http://localhost:50611/TestRep.svc/offices/2", 
dataType: "json", 

success: function (data) { 
json = data; 
alert("done"); 
}, 
error: function (jqXHR, testStatus, errorThrown) { 
jqXHR.status + textStatus + errorThrown); 
} 
}); //ajax 


return json; 

});

来自 ajax 的错误消息(0errorError: Access is denied.)

我也尝试了 XDomainRequest 并得到了相同的错误(Microsoft JScript 运行时错误:访问被拒绝。)任何帮助将不胜感激。

【问题讨论】:

    标签: jquery ajax internet-explorer cross-domain dotnetnuke


    【解决方案1】:

    这可能是由语法错误引起的。去掉这行中http之前多余的":

    url: ""http://localhost:50611/TestRep.svc/offices/2",
    

    【讨论】:

    • 抱歉,我一定是在发帖时添加的。代码中没有。
    猜你喜欢
    • 1970-01-01
    • 2013-12-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多