Bug Tracker

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#14384 closed bug (duplicate)

JQuery 1.10.2 is not working with IE10

Reported by: kushal.patel@… Owned by:
Priority: undecided Milestone: None
Component: ajax Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:

Description

We are facing issue when we are parsing a json data.

Below is the function which throws error

parseJSON: function( data ) {

Attempt to parse using the native JSON parser first

if (window.JSON && window.JSON.parse) {

return window.JSON.parse( data ); We are getting error from this line due to data is undefined

}

if (data === null) {

return data;

}

if ( typeof data === "string" ) {

Make sure leading/trailing whitespace is removed (IE can't handle it) data = jQuery.trim( data );

if ( data ) {

Make sure the incoming data is actual JSON Logic borrowed from http://json.org/json2.js if ( rvalidchars.test( data.replace( rvalidescape, "@" )

.replace( rvalidtokens, "]" ) .replace( rvalidbraces, "")) ) {

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

}

}

}

jQuery.error( "Invalid JSON: " + data );

}

Change History (2)

comment:1 Changed 6 years ago by gibson042

Resolution: duplicate
Status: newclosed

Duplicate of #13169.
undefined is not valid JSON and is expected to generate an exception.

comment:2 Changed 6 years ago by gibson042

Component: unfiledajax
Note: See TracTickets for help on using tickets.