JQuery getJSON Callback Returning Null Data
Posted
by user338828
on Stack Overflow
See other posts from Stack Overflow
or by user338828
Published on 2010-05-11T23:34:21Z
Indexed on
2010/05/11
23:44 UTC
Read the original article
Hit count: 1022
I have a getJSON call that is called back correctly, but the data variable is null. The python code posted below is executed by the getJSON call to the demandURL. Any ideas?
javascript:
var demandURL = "/demand/washington/";
$.getJSON(demandURL, function(data) {
console.log(data);
});
python:
data = {"demand_count":"one"}
json = simplejson.dumps(data)
return HttpResponse(json, mimetype="application/json")
© Stack Overflow or respective owner