[Answer]-Django/JS: json.dumps and parse.json

1👍

The trick is that when you tell jQuery.post that the server is returning JSON it parses it for you.

// This line can be safely removed;
// jQuery is doing it for you behind the scenes
var patients = jQuery.parseJSON(data);

When you use parseJSON on the already parsed data you wind up trying to parse the string representation of a JavaScript object. Simply use the already parsed data and everything should work correctly.

0👍

jQuery is automatically converting the json to js objects for you. You don’t need to call parse yourself.

Leave a comment