我有一个从 api 调用返回的 json 数组,如下所示:
["meta", {"previous"=>nil, "total_count"=>12, "offset"=>0, "limit"=>1, "next"=>"/v1/Account/MAMTE4MTHJNJRKODBIMD/AvailableNumberGroup/?prefix=415&limit=1&country_iso=US®ion=NY&offset=1"}]["api_id", "441d610c-bede-11e2-815d-22000abcc0e1"]["objects", [{"stock"=>57, "voice_enabled"=>true, "region"=>"New York, UNITED STATES", "voice_rate"=>"0.00900", "prefix"=>"631", "sms_rate"=>"0.00800", "number_type"=>"local", "setup_rate"=>"0.00000", "rental_rate"=>"0.80000", "group_id"=>"11411650673450", "sms_enabled"=>true, "resource_uri"=>"/v1/Account/MAMTE4MTHODBIMD/AvailableNumberGroup/11411650673450/"}]]
我可以用这个打印整个数组
success: function(response){
$.each([response], function(i, objects) {
var list = "<li>" + objects + "</li>";
$('#result').append(list);
});
如何提取指定的项目并在其中打印它们<li> .. </li>
以列出一些但不是所有元素的列表?
非常感谢!