1

This request. Returns a file beginning with this:

gdata.io.handleScriptLoaded({"v...

However, when I make this request. It returns a file beginning with this:

// API callbackprocessJSON({"version":"1.0"...

The "//API callback" at the beginning of the file means that the JSONP is not processed correctly by my program.

Any ideas what I am doing wrong or why Google is returning the file as it is.

user1977132
  • 487
  • 2
  • 18
  • Andrew, I get `Bad or unsupported projection for this type of operation.` for both your links - could you double-check them please? – Raad Mar 01 '13 at 13:20
  • I have corrected them, they should work now. I copied a link I was testing by mistake, sorry! – user1977132 Mar 01 '13 at 14:13
  • Using the callback parameter means you're telling Google that you expect to process the response using a function. Take a look at https://developers.google.com/gdata/docs/json for an example, plus http://stackoverflow.com/questions/12849274/googleapi-json-retrieving-data-from-spreadsheet and http://stackoverflow.com/questions/9985798/parse-json-from-google-spreadsheet might be useful too. – Raad Mar 01 '13 at 14:26
  • The problem turned out to be a missing bracket at the end of a function. Nothing to do with what the google API was returning, though I am still interested as to why its response begins //API Callback, when I've tried JSONP calls to other websites (twitter and geonames) it returns with the name of the callback function at the start. Thank you, I'm sorry for wasting your time. Andrew – user1977132 Mar 01 '13 at 14:41
  • Andrew - No problem. I believe the `// API callback` response is a comment on a separate line to indicate the JSON data is being handled by a callback function. – Raad Mar 01 '13 at 14:46

0 Answers0