Commits

Job Ganzevoort  committed b167b19

ajax response content-type application/json

  • Participants
  • Parent commits 9377f4b

Comments (0)

Files changed (2)

File poll/ajax.py

 
         data['total'] = Vote.objects.filter(poll=poll).count()
 
-        return HttpResponse(simplejson.dumps(data))
+        return HttpResponse(simplejson.dumps(data), content_type="application/json")
     return HttpResponse(status=400)

File poll/templates/_polls_script.js

 	
 	function doResults() {
 		$.get(result_url, function(data) {
-			showResults($.parseJSON(data));
+			showResults(data);
 		});
 	}