{"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>\n

This 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

What was even more interesting was that upgrading to Opera 9.50<\/a> also solved the problem independently; that is, things worked fine even with the older version of jQuery. This goes to show the importance of keeping your software up to date and highlights the complicated interactions between different browsers and client-side code in a web application. <\/p>","protected":false},"excerpt":{"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) The issue was with an Ajax request I was sending. […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[75,4,167,242],"tags":[405,446,464],"_links":{"self":[{"href":"https:\/\/unitstep.net\/wp-json\/wp\/v2\/posts\/336"}],"collection":[{"href":"https:\/\/unitstep.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unitstep.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unitstep.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unitstep.net\/wp-json\/wp\/v2\/comments?post=336"}],"version-history":[{"count":0,"href":"https:\/\/unitstep.net\/wp-json\/wp\/v2\/posts\/336\/revisions"}],"wp:attachment":[{"href":"https:\/\/unitstep.net\/wp-json\/wp\/v2\/media?parent=336"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unitstep.net\/wp-json\/wp\/v2\/categories?post=336"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unitstep.net\/wp-json\/wp\/v2\/tags?post=336"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}