実際には、jQuery モバイルを介して 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);