实际上我想通过 jQuery mobile 解析一个 json 数组,但是我被卡住的地方没有被搜索很多,请帮助我。
我的json格式
{
"messagedetails":
[{
"msgData":"DEAR MEMBER\\\"S TODAY\\\"S KITTY WINNER IS N0 55.HOPE YOU ALL ENJOYED THE EVENING. THANK YOU\r\n MAHAVIRD (PLEASE KEEP SLIPS CAREFULLY)",
"requestNosSms":64,
"requestUserid":"16459",
"spamReason":
{
"userApprove":"0",
"senderApprove":"0",
"templateMatch":80,
"templateId":"6586",
"spamKeywords":["winner"],
"maxNosLimit":"0"
},
"id":"5124c1c446923e6c4100005f",
"userName":"MAHAVIR DIAMOND",
"date":"2013-02-20 17:59:57"
},
{
"msgData":"DEAR MEMBER\\\"S TODAY\\\"S KITTY WINNER IS N0 55.HOPE YOU ALL ENJOYED THE EVENING. THANK YOU\r\n MAHAVIRD (PLEASE KEEP SLIPS CAREFULLY)",
"requestNosSms":64,
"requestUserid":"16459",
"spamReason":
{
"userApprove":"0",
"senderApprove":"0",
"templateMatch":80,
"templateId":"6586",
"spamKeywords":["winner"],
"maxNosLimit":"0"
},
"id":"5124c1c446923e6c4100005f",
"userName":"MAHAVIR DIAMOND",
"date":"2013-02-20 17:59:57"
}]
}
我正在使用这样的代码
var test =null;
$.each(data, function(i,messages) {
test = test + "<h1>"+messages][2]+"</h1>";
});
$("#results").html(test);