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.
- [Answer]-Radio Button Vertical Renderer
- [Answer]-Call to django view returning results from another view
- [Answer]-Matching manytomany fields in django
- [Answer]-Django forms processing dynamic field labels
Source:stackexchange.com