带转义符的json解释

1.json数组:jsonData。取json数组中message的appid的值。例子:

var jsonData =  {
"code":"200",
"message":"{\"appid\":\"test123\",\"data\":\"PhcDgwpfphWQMzgxmum5DwMKep2QAOqCjyyf7ltwnV/091FNi2/ERnTV92r9A154Ruo+fAK7foNaZCBXSw1IRbQ6StG/X4G+OvvOLavDiA1pRD+4hId6jDO11xTnegAllvZcAsn7jpp8ye8ewtzPpM5RJvhEzoVA\",\"signkey\":\"932ffd030344f11af5fe5a626b0e6d99\",\"url\":\"http://www.baidu?id=332503\"}"
};
var json_str = JSON.stringify(jsonData);
var json_str2 = JSON.parse(json_str);
var msg2 = json_str2.message;
var msg3 = JSON.parse(msg2);
var msg4 = msg3.appid;
console.log(msg4);
上一篇:全面解析sizeof(上) 分类: C/C++ StudyNotes 2015-06-15 10:18 188人阅读 评论(0) 收藏


下一篇:如何实现 javascript “同步”调用 app 代码