jQuery.getJSON不能正常工作在IE8与gdata的JSON-C。为什么?

问题描述:

使用jQuery:

$.getJSON('http://gdata.youtube.com/feeds/api/videos/b2-5GSjZvW8?v=2&alt=jsonc', function(meta){alert(meta.data.title);});

Firefox和Chrome预期这两个工作,但IE浏览器不断触发错误功能(当使用 $。阿贾克斯),而不是成功。错误状态是0,这没有太大的帮助。

Firefox and Chrome both work as expected, but IE keeps triggering the error function (when using $.ajax) instead of success. The error status is "0" which doesn't help much.

我也试着使用 $ AJAX 缓存:。假无济于事

I've also tried using $.ajax with cache:false to no avail.

任何想法?

我不能告诉你,如果它在jQuery的或IE浏览器错误,但它看起来像XDomainRequest在IE中失败。该加入的网址:

I can't tell you if it's an error in jquery or IE, but it looks like the XDomainRequest fails in IE. Add this to the URL:

&callback=?

......这样的回应将被处理为JSONP。

...so the response will be handled as jsonp.

编辑:它看起来像微软的 XDOmainRequest 是不是在jQuery的实现,所以你不能运行使用IE浏览器(除JSONP)跨域,请在jQuery的

It looks like Microsoft's XDOmainRequest is not implemented in jQuery, so you can't run Cross-Domain-Requests in jQuery using IE(except jsonp)