JSON数组排序 高分求大神,在线等 急急急急急急急急急急!!!!!!!!!!!!
var objs=[{order:1,name:"sam",key:"key"},{order:2,name:"tam",key:"key"}....];
按照 order name key 升序
求大神!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[解决办法]
其他两个都是字符串,只能说按照order升序吧
[解决办法]
var objs=[{order:2,name:"sam",key:"key"},{order:1,name:"tam",key:"key"},{order:3,name:"uam",key:"key"}];
objs.sort(function(a,b)
{
if(a.order > b.order)
return 1;
else
return -1;
}
)
写一个按order升序的,其他的赋值给临时array,楼主自己再写一段就可以了
[解决办法]
http://james.newtonking.com/pages/json-net.aspx