I am new to jQuery and maybe this is question n00b. And also my English is not the best.
I wrote a service in my Google App Engine application that delivers data in JSON format, which works fine, but I was not able to parse the JSON data using jQuery:
var url= 'myapp.appspot.com/myservice.json?someparams';
$.getJSON(url, function(json){
alert("Success parsing JSON");
....
});
After days of reading posts and tutorials, I felt this slide show: http://www.slideshare.net/andymckay/cross-domain-webmashups-with-jquery-and-google-app-engine
While reading slide 23, I noticed a "callback =?" and I tried the code in slide 42:
class MyJSONHandler(webapp.RequestHandler):
def get(self):
jsonData = json.dumps(data)
if self.request.get('callback'):
self.response.out.write('%s(%s)' % (self.request.get('callback'), jsonData))
else:
self.response.out.write(jsonData)
And in the jQuery function:
$.getJSON(url+'&callback=?', function(json){
alert("Success parsing JSON");
....
});
My question is:
" " ? : "?" ( "MyJSON": [{ "a-lot": "of-data" }]) '??
.