标签:utf-8 sort nbsp turn space keyword 自带 comm href
<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title></title> </head> <body> <script type="text/javascript"> //利用jquery中的get方法获取json数据 $.get("exp.json","",function(data){ var newdata=data.result //根据价格(price)排序 function sortprice(a,b){ return a.price-b.price } //利用js中的sort方法 newdata.sort(sortprice); //打印排序后的数据到控制台 console.log(newdata); }) </script> </body></html>标签:utf-8 sort nbsp turn space keyword 自带 comm href
原文地址:https://www.cnblogs.com/mark5/p/11593590.html