RobertFischer / JQuery-PeriodicalUpdater

A port of Prototype's PeriodicalUpdater to JQuery
282 stars 50 forks source link

JSON encoded response throws SyntaxError: Unable to parse JSON string error #4

Closed liveline closed 13 years ago

liveline commented 14 years ago

When attempting to poll an action that returns a JSON encoded string the plugin is throwing a SyntaxError (FF 3.6.3, Safari 4.0.5) when attempting to parse the response. On line 122 you're manually attempting to parse the response into a JSON object. I believe jQuery.ajax does the parsing for you automatically so this step should be unnecessary (at least with jQuery 1.4).

Good plugin though, thanks for sharing it with the world.

bcfox commented 14 years ago

Yeah, had to comment out the following lines (around 136) lines: if(ajaxSettings.dataType == 'json') { remoteData = JSON.parse(remoteData); }

drupol commented 13 years ago

It seems that jQuery changed some stuff.