I have the following jquery in my code$j.getJSON("http://localhost:8080/WWTestHarnessWEB/ReadersToolkitFinalController.htm?jsoncallback=?", {'uID': 1}, function(data){alert(data);});
The json that i am returning looks like the following ({"positiveCount":"0","negativeCount":"999"})
But my alert is never firing.
Any idea what i need to do to ensure that this will work?
regards
Damien
I believe that if you’re using a different name for the callback query string parameter than
callback(looks like you’re usingjsoncallbackinstead), you have to tell jQuery; see thejsonpparameter in the options object on the$.ajaxcall. This means you’ll have to useajaxinstead ofgetJSON, but that’s easy enough.E.g.:
I’m not sure whether you need to (or should) include the “jsoncallback=?” in the URL yourself or let jQuery put it in; a quick experiment should tell you.