{"d": {"__type":"HPROffice.Fault","status":"ok","message":"Record exist","Details":null,"First":"{\"status\" : \"OK\", data : [{\"uid\":1,\"groupname\":\"SK Softlab\", \"ownername\": \"Santosh\",
\ “移动\”:\ “9982598102 \”,\ “移动电话2 \”:空,\ “savetime \”:\ “\ /日期(15013.53亿)\ / \”,\ “状态\”:真, \ “额外\”:空,\ “saveby \”:1,\ “updateby \”:空,\ “更新时间\”:空,\ “openingbalance \”:5000}] }”, “第二”:空, “三”:空, “四”:空, “十五”:空} }
我正在尝试这个
function loaddata(grpid)
{
$.ajax({
type: "POST",
url: "managegroup.aspx/LoadGroup",
contentType: "application/json; charset=utf-8",
dataType: "json",
data: "{grpid:" + grpid + "}",
success: function (response) {
//alert("called");
var jsonobj = response.d;
if (jsonobj.status == "ok") {
Clear();
alert(jsonobj.First);
var json = JSON.parse(jsonobj.First);
//var json = $.parseJSON("'"+jsonobj.First+"'");
alert(json.status);
}
else {
$("#msg").css("color", "red");
}
$("#msg").text(response.d.message);
},
error: function (response) {
}
});
}
答案 0 :(得分:0)
从我的问题中我可以看出你是如何将json字符串转换为json对象的。如果这是正确的,请查看以下内容。
JSON.parse('{"mobile\":\"9982598102\",\"mobile2\":null}');
文档:https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse