首页 新闻 会员 周边 捐助

JQuery 的getJSON返回值 使用的问题

0
悬赏园豆:20 [已关闭问题]

比如我返回的内容是这样

如何拿到第三个 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)}]

君宝的主页 君宝 | 初学一级 | 园豆:97
提问于:2009-03-25 16:56
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册