jQuery的的getJSON跨域 [英] jQuery getJSON cross domain
问题描述
我试图让使用jQuery跨域(在github)的数据..但没有成功! 我读了我必须做出一个请求JSONP,但我不明白什么是错的。
I'm trying to get the data with jQuery Cross Domain (on github).. but without success! I read that i must make a request jsonp, but I do not understand what is wrong..
Chrome浏览器跨$ P $点的文件,如JavaScript .. IE9除了一个警告,因为文件被阻止由于MIME类型不匹配.. 我甚至不知道是否有从.txt和.json的差异。
Chrome interprets the file as Javascript.. IE9 except a warning because the file "was blocked due to mime type mismatch".. I do not even understand if there is a difference from .txt and .json.
推荐答案
在这里,我们又来了...
您与战斗<一个href="http://en.wikipedia.org/wiki/Same_origin_policy">http://en.wikipedia.org/wiki/Same_origin_policy.
And here we go again...
You are fighting with http://en.wikipedia.org/wiki/Same_origin_policy.
虽然
While
可能的解决办法是使用像<一个本地代理href="http://developer.yahoo.com/javascript/howto-proxy.html">http://developer.yahoo.com/javascript/howto-proxy.html
Possible solution will be using a local proxy like http://developer.yahoo.com/javascript/howto-proxy.html
这篇关于jQuery的的getJSON跨域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!