Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/haskell/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何解析jQuery或AngularJS中数组的json数组_Javascript_Jquery_Json_Angularjs - Fatal编程技术网

Javascript 如何解析jQuery或AngularJS中数组的json数组

Javascript 如何解析jQuery或AngularJS中数组的json数组,javascript,jquery,json,angularjs,Javascript,Jquery,Json,Angularjs,您好,我的Json如下所示,我想解析它以将数据绑定到数组。请提供我如何解析它 [ { "ImgUrl": "http://www.cowboysalamocityharley.com/used_bikes/DSC_7815.JPG", "CarouselImages": [ "http://www.cowboysalamocityharley.com/used_bikes/th_DSC_7816.JPG", "http://www.cowboysala

您好,我的Json如下所示,我想解析它以将数据绑定到数组。请提供我如何解析它

[
  {
    "ImgUrl": "http://www.cowboysalamocityharley.com/used_bikes/DSC_7815.JPG",
    "CarouselImages": [
      "http://www.cowboysalamocityharley.com/used_bikes/th_DSC_7816.JPG",
      "http://www.cowboysalamocityharley.com/used_bikes/th_DSC_7817.JPG",
      "http://www.cowboysalamocityharley.com/used_bikes/th_DSC_7818.JPG",
      "http://www.cowboysalamocityharley.com/used_bikes/th_DSC_7819.JPG",
      "http://www.cowboysalamocityharley.com/used_bikes/th_DSC_7820.JPG",
      "http://www.cowboysalamocityharley.com/used_bikes/th_DSC_7821.JPG",
      "http://www.cowboysalamocityharley.com/used_bikes/th_DSC_7822.JPG"
    ],
    "VehicleId": 1
  },
  {
    "ImgUrl": "http://www.cowboysalamocityharley.com/used_bikes/DSC_7816.JPG",
    "CarouselImages": [
      "http://www.cowboysalamocityharley.com/used_bikes/th_DSC_7816.JPG",
      "http://www.cowboysalamocityharley.com/used_bikes/th_DSC_7817.JPG",
      "http://www.cowboysalamocityharley.com/used_bikes/th_DSC_7818.JPG",
      "http://www.cowboysalamocityharley.com/used_bikes/th_DSC_7819.JPG",
      "http://www.cowboysalamocityharley.com/used_bikes/th_DSC_7820.JPG",
      "http://www.cowboysalamocityharley.com/used_bikes/th_DSC_7821.JPG",
      "http://www.cowboysalamocityharley.com/used_bikes/th_DSC_7822.JPG"
    ],
    "VehicleId": 2
  },
  {
    "ImgUrl": "http://www.cowboysalamocityharley.com/used_bikes/DSC_7817.JPG",
    "CarouselImages": [
      "http://www.cowboysalamocityharley.com/used_bikes/th_DSC_7816.JPG",
      "http://www.cowboysalamocityharley.com/used_bikes/th_DSC_7817.JPG",
      "http://www.cowboysalamocityharley.com/used_bikes/th_DSC_7818.JPG",
      "http://www.cowboysalamocityharley.com/used_bikes/th_DSC_7819.JPG",
      "http://www.cowboysalamocityharley.com/used_bikes/th_DSC_7820.JPG",
      "http://www.cowboysalamocityharley.com/used_bikes/th_DSC_7821.JPG",
      "http://www.cowboysalamocityharley.com/used_bikes/th_DSC_7822.JPG"
    ],
    "VehicleId": 3
  },
  {
    "ImgUrl": "http://www.cowboysalamocityharley.com/used_bikes/DSC_7818.JPG",
    "CarouselImages": [
      "http://www.cowboysalamocityharley.com/used_bikes/th_DSC_7816.JPG",
      "http://www.cowboysalamocityharley.com/used_bikes/th_DSC_7817.JPG",
      "http://www.cowboysalamocityharley.com/used_bikes/th_DSC_7818.JPG",
      "http://www.cowboysalamocityharley.com/used_bikes/th_DSC_7819.JPG",
      "http://www.cowboysalamocityharley.com/used_bikes/th_DSC_7820.JPG",
      "http://www.cowboysalamocityharley.com/used_bikes/th_DSC_7821.JPG",
      "http://www.cowboysalamocityharley.com/used_bikes/th_DSC_7822.JPG"
    ],
    "VehicleId": 4
  }
]
有什么方法可以使用内置库解析它,或者需要循环吗?

试试这个

var json = eval("(" + result + ")");
试试这个:

var arr = JSON.parse(data);

你说的解析是什么意思?