user2819851
user2819851

Reputation: 3541

Jquery 1.10.2 not working in IE10 - JSON

I'm facing issue when 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" ) {
        data = jQuery.trim( data );
    if ( data ) {
        if ( rvalidchars.test( data.replace( rvalidescape, "@" )
            .replace( rvalidtokens, "]" )
            .replace( rvalidbraces, "")) ) {
                return ( new Function( "return " + data ) )();
            }
        }
    }
    jQuery.error( "Invalid JSON: " + data );
}

Thanks in Advance

Upvotes: 1

Views: 574

Answers (1)

alejo802
alejo802

Reputation: 2117

Your JSON data might be wrong. See

http://jsonformatter.curiousconcept.com/ 

to validate it.

Upvotes: 2

Related Questions