如何在Javascript中解析JSON?

时间:2016-05-17 13:32:18

标签: javascript c# json

我正在通过AJAX调用跟踪JSON,这是因为项目符号后的\ t无效,因此我在JSON.Parse(data.d)函数中收到javaScript错误。 你能否建议如何处理这种情况?



{ "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" }]
}




1 个答案:

答案 0 :(得分:0)

使用replace

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