交换json值

时间:2015-08-04 10:30:27

标签: javascript jquery json

我需要在按钮点击时使用jquery交换第一行和第二行。是否有任何json预定义函数来交换两个json数组。

  var arr = [
           { "ID": 135, "Name": "Fargo Chan", "Address": "34, Baker Street" },
           { "ID": 432, "Name": "Aaron Luke", "Address": "BLDG 1, J Street" },
           { "ID": 252, "Name": "Dilip Singh", "Address": "Hotel J, SE" }
         ];

  var arr = [
          { "ID": 432, "Name": "Aaron Luke", "Address": "BLDG 1, J Street" },
          { "ID": 135, "Name": "Fargo Chan", "Address": "34, Baker Street" },     
          { "ID": 252, "Name": "Dilip Singh", "Address": "Hotel J, SE" }
       ];

0 个答案:

没有答案