【发布时间】:2014-06-04 06:27:17
【问题描述】:
我有一个 ASP.NET MVC 应用程序将 JSON 字符串返回给 VIEW。
// Parsing the model returned on the VIEW
var jsonString = '@Html.Raw(Model.ToJson())';
var jsonObj = JSON.parse(jsonString);
问题是我无法解析,因为 jsonString 包含“\”和“'”等字符。
//Sample string
{ "description" : "<p>Sample<span style=\"color: #ff6600;\"> Text</span></strong></p>" }
【问题讨论】:
标签: javascript json asp.net-mvc parsing