Here is a sample response:
200: {"timestamp": 1402348389.349506, "messages": {"b": "more not working", "c": "i get it already", "a": "not working"}}WTF???
Here is the AJAX.
this.pollForUpdates = function() {
$.ajax({
type:"POST",
url:"{% url 'message_poller' %}",
data: {'lastmessage_received': this.last_received, 'address': this.getAddressJson() },
success : function(json) { doSomething(json)},
error : function(xhr,errmsg,err) {
alert(xhr.status + ": " + xhr.responseText + 'WTF???'); },
});
};
Return in view:
response = json.dumps({'messages': {"a": "not working", "b": "more not working", "c": "i get it already"}, "timestamp": time.time() })
return HttpResponse(response, content_type='application/javascript')
So I'm pretty much stumped here. All of my other AJAX POST calls work fine with the same HttpResponse.