views:

306

answers:

2

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.

Any ideas?

Edit: I want to download and display this json data in Firefox 3.5

https://www.google.com/reader/api/0/stream/contents/feed/http%3A//stackoverflow.com/feeds/question/1783288

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.

A: 

You probably need to look at jsonp:

http://www.insideria.com/2009/03/what-in-the-heck-is-jsonp-and.html

Sounds like a cross domain problem that you might be able to work out with jsonp.

matpol
But Google provides data only in JSON format.
Priyank Bolia
Possibly yes but have a look at this page with the tester - it might help.
matpol
sorry here's the link: http://personalized20.blogspot.com/2006/04/json-feeds-of-google-reader.html
matpol
no - the urls are in a different format
matpol
A: 

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.

Priyank Bolia