jQuery parsererror: clean up your JSON objects

Sunday, March 7, 2010 - 11:49 pm
By Colin

Has your JSON using jQuery web app suddenly stopped working?  Getting a parsererror on your JSON objects, where you got none before?  This is what happened to me when my site upgraded to jQuery 1.4.

I use the Google API’s jQuery, and it automatically upgraded my whole site to jQuery 1.4.   In jQuery 1.4, they decided to tighten up the JSON parsing engine, so that it is now unforgiving of any lax standards.  You have to follow the JSON standard spelled out here — to the letter.  In my case, that meant changing any single quoted values or names to double quotes, and getting rid of opening and closing parentheses.  Like most fixes, it was an easy fix, once I figured it out.  Hope this helps.


One Response to “jQuery parsererror: clean up your JSON objects”

  1. Thanks so much! It help quite alot.


Leave a Reply