如何在jQuery中解析JSON编码的数组?

时间:2015-11-17 06:15:45

标签: javascript jquery json asp.net-mvc-4

我有一个列表'结果'在控制器中,我使用下面的代码将此列表转换为json。

JavaScriptSerializer jss = new JavaScriptSerializer();
            string output = jss.Serialize(result);

。现在我需要在jQuery中解析Json结果。我将var model = @Html.Raw(Json.Encode(Model))放在javascript中,我的模型为:

ContentEncoding: null
ContentType: null
Data: "[{"type":"Size","ID":16,"title":"10X20","value":null,"isDefault":true,"Rate":0,"Product_ID":42,"Parent_ID":0},{"type":"Size","ID":17,"title":"10X18","value":null,"isDefault":false,"Rate":0,"Product_ID":42,"Parent_ID":0},{"type":"Size","ID":18,"title":"10X15","value":null,"isDefault":false,"Rate":0,"Product_ID":42,"Parent_ID":0}]"
JsonRequestBehavior: 1
MaxJsonLength: null
RecursionLimit: null

0 个答案:

没有答案