Jason, Thanks for looking into this. Following is my code: -----START----- function fetchData(url, callback) { var params = {}; params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.JSON; gadgets.io.makeRequest(url, function(response) { console.log(response) var data = response.data; if (data == null) { console.log("Error fetching URL: " + response.errors); } else { callback(data); } }, params); } ----END-----
The response.data is null, response.text has the JSON as text and response.errors is "failed to parse JSON" Jason wrote: > When are you seeing this error? Is this after the JSON string is > returned from your server? If so, how are you parsing it? JSON > responses are stored in the response object's 'data' property > (response.data as opposed to response.text) so this may be part of > your problem. If you are able to post a code snippet from your > callback, it may help to track down the exact cause of your problem. > > - Jason > > On Feb 14, 6:23 am, Nikhil Gupte <[EMAIL PROTECTED]> wrote: > > I'm getting errors in gadgets.io.makeRequest when I try to fetch JSON > > documents. > > My document is simple: > > {score: "20"} > > > > The response.text for it in Firebug is > > "{score: \"20\"}" > > > > The exact error is: > > "failed to parse JSON" > > > > Is this an Orkut/Open Social bug or am I missing something? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Orkut Developer Forum" group. To post to this group, send email to opensocial-orkut@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/opensocial-orkut?hl=en -~----------~----~----~----~------~----~------~--~---