【发布时间】:2012-04-15 09:41:49
【问题描述】:
我在调试 AJAX 请求时遇到问题。 (它是async,因为它是一条隧道)
无论如何,它在 Chrome 和 Firefox 上运行良好,但至少在 IE8/9 中失败。
var responseA = '';
$.ajax({
type: 'GET',
url: 'http://pipes.yahooapis.com/pipes/pipe.run?_id=xxxxxx&url=http%3A%2F%2Fwww.rottentomatoes.com%2Fm%2Fthe_hunger_games%2F&_render=json',
async: true,
dataType: 'json',
success: function(text) {
responseA = text;
},
error: function(jqXHR, textStatus, errorThrown) {
console.log(errorThrown);
}
});
console.log(responseA);
errorThrown 抛出LOG: No Transport
我尝试添加$.support.cors = true;
尝试解决任何跨域问题,但现在我得到了
LOG: Error: Access is denied.(仅在 IE 中)提供了什么?
【问题讨论】:
-
如果要使用跨域AJAX请求,需要指定
dataType的jsonp而不是json。 -
我读到这不适用于
async
标签: jquery ajax internet-explorer-9 yahoo-pipes