var json = '{"Users":[{"Name":"user999","Value":"test"},{"Name":"test2","Value":"test"}]}';var json_parsed = $.parseJSON(json);for (var u = 0; u < json_parsed.Users.length; u++){ var user = json_parsed.Users[u]; $('body').append($('<p>').html('User: '+user.Name+'<br />Value: '+user.Value));}
结果是:
<p>User: user999<br />Value: test</p><p>User: test2<br />Value: test</p>
jsFiddle示例:http://jsfiddle.net/bradchristie/XtzjZ/1/
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)