Javascript 将JSON数据拆分为两个单独的数组

Javascript 将JSON数据拆分为两个单独的数组,javascript,jquery,arrays,ajax,json,Javascript,Jquery,Arrays,Ajax,Json,我试图获取一个JSON url,并将所有信息处理到两个单独的数组中。数据上的第一个数组以“output_no_match”开头,第二个数组的格式相同,以“avalanche_with_match”开头。我一直在研究如何准确地将数据放入两个单独的数组中,然后进行处理(并将其放入图形中) 谢谢你的帮助 [{"date":"2014-12-01T00:00:00-06:00" "id":null "balance":915047.12 "interest":710669475.15 "interest

我试图获取一个JSON url,并将所有信息处理到两个单独的数组中。数据上的第一个数组以“output_no_match”开头,第二个数组的格式相同,以“avalanche_with_match”开头。我一直在研究如何准确地将数据放入两个单独的数组中,然后进行处理(并将其放入图形中)

谢谢你的帮助

[{"date":"2014-12-01T00:00:00-06:00"
"id":null
"balance":915047.12
"interest":710669475.15
"interest_paid":10199.29
"ending_principal_balance":915047.12
"ending_interest_balance":710659275.86
"payment_due":10199.29}

假设您有一个位于的文件,其中包含JSON数据:

{"output_no_match": [{
    "date": "2014-12-01T00:00:00-06:00",
    "id": null,
    "balance": 915047.12,
    "interest": 710669475.15,
    "interest_paid": 10199.29,
    "ending_principal_balance": 915047.12,
    "ending_interest_balance": 710659275.86,
    "payment_due": 10199.29
}],
"avalanche_with_match": [{
    "date": "2014-12-01T00:00:00-06:00",
    "id": null,
    "balance": 915047.12,
    "interest": 710669475.15,
    "interest_paid": 10199.29,
    "ending_principal_balance": 915047.12,
    "ending_interest_balance": 710659275.86,
    "payment_due": 10199.29
}]},
然后您可以使用XMLHttpRequest(使用jQuery)获得它:

$.get('http://your-host/sampleData.json').success(function(data){
   //data is js object with your arrays
});