{"id":336,"date":"2008-06-25T19:45:43","date_gmt":"2008-06-26T00:45:43","guid":{"rendered":"http:\/\/unitstep.net\/?p=336"},"modified":"2008-06-25T19:46:38","modified_gmt":"2008-06-26T00:46:38","slug":"upgrade-jquery-for-better-opera-support-or-just-upgrade-opera","status":"publish","type":"post","link":"https:\/\/unitstep.net\/blog\/2008\/06\/25\/upgrade-jquery-for-better-opera-support-or-just-upgrade-opera\/","title":{"rendered":"Upgrade jQuery for better Opera support (Or just upgrade Opera)"},"content":{"rendered":"
I ran into a weird problem while testing one of my sites that used jQuery with Opera 9.26. (I happened to be using this older version of Opera because I am lazy to upgrade; I’m still using Firefox 2 despite the successful launch of FF3)<\/p>\n
The issue was with an Ajax request I was sending. The return value was an array in JSON form. More specifically, the server was returning something like:<\/p>\n
{tag:[{id1:'A',id2:'B'}, {id1:'A',id2:'B'}, {id1:'A',id2:'B'}]}<\/code><\/pre>\nThis was perfectly valid and worked fine in both Firefox and Internet Explorer. However, in Opera 9.26, I got a JavaScript error indicating that the JSON was not valid. It was then that I realized I was using an older version of jQuery, v1.2.2. Upgrading to the latest<\/a>, 1.2.6 fixed the problem. Strangely, I could not find anything on their bug tracker indicating that such a problem (JSON and Opera) had been fixed.<\/p>\n