如何在jquery中循环json数据

时间:2013-02-01 03:15:08

标签: jquery json

我的JSON数据就像

{
    "Brand":["EM-03","TORRES"],
    "Price":["5.00000","10.00000","15.00000"],
    "Country":["US","SG"]
}

我想将JSON数据循环到

Brand = 
  EM-03 -
  TORRES

Price = 
  5.00000 -
  10.00000 -
  15.00000

Country = US - SG

2 个答案:

答案 0 :(得分:1)

$.each

$.each(data, function(key, value){
   console.log(value); 
});

答案 1 :(得分:0)

试试这个

$.each(data, function(key, value){
   console.log(value.join('-')); 
});