我正在通过jQuery ajax
获取JSONP crossDomain请求的回复
$.ajax({
url: "http://ipinfo.io/{/literal}{$smarty.server.REMOTE_ADDR}{literal}/json",
dataType: 'jsonp',
async: true,
cache: false,
contentType: "text/json; charset=utf-8",
crossDomain: true,
success: function(response){
$("#apply_modal").modal({
remote: load_url
});
},
error: function(err){
console.log(err);
}
});
这似乎在IE10中根本不起作用,但适用于所有其他浏览器。
当我打开DebugBar
时,它再次起作用。
我无法理解为什么。上面的javascript没有错误
会出现什么问题?
答案 0 :(得分:0)
我认为错误是console.log
而不是JSONP。当开发人员工具栏打开时,IE仅包含console
。尝试创建一个存根,或使用警报,而你应该没有问题