比如我返回的内容是这样
如何拿到第三个 Messagestr 熟悉的值呢?(Messagestr使用的是stringbuild格式)
function getmsg()
{
$.getJSON("getmsg.jsp",{speaker:$("#speaker").val(),roomid:$("#roomid").val()},function(data){
$.each(data,function(i,n){$("#txt").val(n.Speaker.id);});
alert(data);
});
}
firebug提示Speaker为空。。。。
[{"Speaker":null,"Listeners":[99999],"Messagestr":{"Capacity":16,"MaxCapacity":2147483647,"Length":4
},"Time":new Date(1237998934203)},{"Speaker":{"id":1,"UserName":null,"PassWord":null,"GetPassWordQuestion"
:null,"GetPassWordAnswer":null,"EMail":null,"TrueName":null,"Sex_radio":null,"Birthday":null,"Location"
:null,"Address":null,"PostCode":null,"Mobile":null,"Tel":null,"RegTime":null,"ChangeTime":null,"smtp"
:null,"postdate":null,"FromPage":null,"GongYingShangId":null,"Method":null},"Listeners":[2],"Messagestr"
:{"Capacity":16,"MaxCapacity":2147483647,"Length":9},"Time":new Date(1237998934203)},
{"Speaker":{"id":1,"UserName":null,"PassWord":null,"GetPassWordQuestion":null,"GetPassWordAnswer":null,"EMail":null,"TrueName"
:null,"Sex_radio":null,"Birthday":null,"Location":null,"Address":null,"PostCode":null,"Mobile":null,"Tel"
:null,"RegTime":null,"ChangeTime":null,"smtp":null,"postdate":null,"FromPage":null,"GongYingShangId"
:null,"Method":null},"Listeners":[2],"Messagestr":{"Capacity":16,"MaxCapacity":2147483647,"Length":8
},"Time":new Date(1237999029656)},
{"Speaker":{"id":1,"UserName":null,"PassWord":null,"GetPassWordQuestion"
:null,"GetPassWordAnswer":null,"EMail":null,"TrueName":null,"Sex_radio":null,"Birthday":null,"Location"
:null,"Address":null,"PostCode":null,"Mobile":null,"Tel":null,"RegTime":null,"ChangeTime":null,"smtp"
:null,"postdate":null,"FromPage":null,"GongYingShangId":null,"Method":null},"Listeners":[2],"Messagestr"
:{"Capacity":16,"MaxCapacity":2147483647,"Length":3},"Time":new Date(1237999334171)}]