简体   繁体   中英

How to Parse JSON in Javascript?

I am getting following JSON through AJAX call which is Invalid due to \\t after bullet point, Due to this i am getting javaScript error in JSON.Parse(data.d) function. Could you please suggest how to handle this situation ?

 { "Initial" :[ {"IncidentNumber" : "INCB68686857575" , "IncidentStart": "22-Apr-2016 11:03" , "Title": "aaa", "ServiceName": "a", "Status": "Service Down", "UsersImpacted": "MULTIPLE" , "Circle": "a" , "RecoveryActivity": "•\\tJohn Michel USA Country nextline•\\tABC DEF GDH LMN India" , "EstimatedRestorationTime": "a" , "OwningOrLeadTeam": "a" , "SupportingTeams": "a" , "IncidentLead": "a", "Resiliency": "To Be Determined", "NextUpdateGMTTime": "17-May-2016 12:48" }] } 

Use replace

var stringified = JSON.stringify(data);
JSON.parse(stringified.replace(/"/g,'"'));  

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM