JQuery的对谷歌的JSON失败,错误405? [英] JQuery on Google JSON fails with Error 405?
问题描述
我无法理解,怎么做,从谷歌服务器获取JSON数据,请求失败,405 HTTP错误(不允许的方法的)。但我可以手动或使用的file_get_contents
API使用PHP我的Web服务器上下载的JSON文件。但我想客户端浏览器直接下载JSON数据。上有SO一些类似的问题,但我仍然无法理解如何做到这一点。
I am not able to understand, how to do fetch JSON data from Google servers, the requests fails with 405 HTTP error (Method Not Allowed). But I can download the JSON file manually or using PHP on my web server using file_get_contents
API. But I want client browsers to download the JSON data directly. There are some similar questions on SO, but I am still not able to understand how to do that.
任何想法?
编辑:我想下载,并在Firefox 3.5中显示此JSON数据
I want to download and display this json data in Firefox 3.5
<一个href="https://www.google.com/reader/api/0/stream/contents/feed/http%3A//stackoverflow.com/feeds/question/1783288" rel="nofollow">https://www.google.com/reader/api/0/stream/contents/feed/http%3A//stackoverflow.com/feeds/question/1783288
我可以下载由指定?回调文件=?在URL中,但无法读取数据,然后。我愿意接受任何其他的方法还,而不仅仅是jQuery的,但它必须是客户端的JavaScript。
I can download the file by specify ?callback=? in the URL, but can't read the data then. I am open to any other method also, rather than just jquery but it has to be client side javascript.
推荐答案
看起来你无法在Firefox中跨域请求使用?回调= ?,获取数据的jQuery的,但无法返回,因为它是不在JSONP格式。
Looks like you can't make cross domain request in firefox, using ?callback=?, gets the data in the jquery but fails to return as it is not in the jsonp format.
这篇关于JQuery的对谷歌的JSON失败,错误405?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!