If you are getting the exception message Microsoft JScript compilation error: Syntax error
for $.parseJSON method.
In order to rectify the issue follow the steps below,
- Probably this issue is caused by the jSon string you are trying to parse
var tmpJSon = '[{"SectionId":1132,"ModifiedBy":0,"SectionName":"
As you see above jSon string contains "
- Before calling $.parseJSON or jQuery.parseJSON function of jQuery remove the encoding, i.e. replace " by ”
var tmpJSon = tmpJSon .replace(/"/ig, '"'); var jSonObject = $.parseJSON(tmpJSon );
- Most probably this time you may not the exception i.e. Microsoft JScript compilation error: Syntax error