Bug Tracker

Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#7106 closed bug (invalid)

jQuery.parseJSON fails on Chrome

Reported by: lgpueyo Owned by:
Priority: low Milestone: 1.4.3
Component: misc Version: 1.4.2
Keywords: parseJSON, chrome Cc:
Blocked by: Blocking:


When parsing the attached json with jQuery.parseJSON, a SyntaxException is raised under Chrome (6.0.472.63). Solution is to modify lines in jquery-1.4.2.js from 511:

<code> return window.JSON && window.JSON.parse ? window.JSON.parse( data ) : (new Function("return " + data))(); </code>

with the following:

<code> if ( window.JSON && window.JSON.parse ) {

try{return window.JSON.parse( data );}catch(e){return(new Function("return " + data))()}

} else {

return (new Function("return " + data))();

} </code>


Attachments (1)

sample.json.zip (22.7 KB) - added by lgpueyo 5 years ago.

Download all attachments as: .zip

Change History (4)

Changed 5 years ago by lgpueyo

comment:1 Changed 5 years ago by snover

  • Resolution set to invalid
  • Status changed from new to closed

Thank you for the report, but this is not a bug. Your JSON is invalid, which is exactly what jQuery is telling you. Please use JSONLint. In the future, please use the jQuery Forum for support requests.

comment:2 follow-up: Changed 5 years ago by anonymous

it still not fixed in current verion ? Coz parsejson does not work in chromium.

comment:3 in reply to: ↑ 2 Changed 5 years ago by jitter

  • Cc lgpueyo@… removed
  • Component changed from unfiled to misc
  • Priority changed from undecided to low

Replying to anonymous:

it still not fixed in current verion ? Coz parsejson does not work in chromium.

What is not fixed?? This ticket was invalid as the JSON was invalid. --> How to report bugs

Note: See TracTickets for help on using tickets.