日期:2014-05-16 浏览次数:20428 次
$.getJSON("basic.json", function(data){
$.each(data.result, function(i,item){
var list = new Array();
list.push(item.name);
});
<script type="text/javascript" src="http://www.coding123.net/js/jquery.js"></script>
<script>
var data = { result: [{ "可变的字符串": ["aa"] }, { "可变的字符串": ["bb"]}] };
var list = new Array();
$.each(data.result, function (i, item) {
for (attr in item)
list.push(item[attr][0]);
});
alert(list);
</script>
for(var key in item){
list.push(item[key]);
}