时间:2021-07-01 10:21:17 帮助过:79人阅读
$.post("json.json",function(data){
data.sort(function(a,b){return a.num-b.num;});
for(var i=0;i<data.length;i++){
var nums=data[i].num;
document.writeln(nums);
}
},"json")
json数据:
[
{
"num":"5"
},
{
"num":"1"
},
{
"num":"3"
},
{
"num":"2"
}
]