jQuery getJSON跨域

时间:2012-06-17 15:43:29

标签: javascript jquery ajax json

我正在尝试使用jQuery Cross Domain(在github上)获取数据..但没有成功! 我读到我必须提出请求jsonp,但我不明白有什么问题。

http://jsfiddle.net/jzjVh/

Chrome会将该文件解释为Javascript .. IE9除了警告,因为文件“由于mime类型不匹配而被阻止”.. 我甚至不理解.txt和.json是否有区别。

1 个答案:

答案 0 :(得分:12)

我们又来了...... 你正在与http://en.wikipedia.org/wiki/Same_origin_policy作战。

enter image description here

enter image description here

可能的解决方案是使用像http://developer.yahoo.com/javascript/howto-proxy.html

这样的本地代理

enter image description here

相关问题