当前位置: 动力学知识库 > 问答 > 编程问答 >

jquery - How to parse multi dimentional json response in ajax call

问题描述:

below is the json response which i'm getting,

{

"day": ["Thursday", "Friday", "Saturday", "Sunday"],

"date": ["03-01-2012", "03-02-2012", "03-03-2012", "03-04-2012"]

}

i want to parse it for day and date differently.

网友答案:

The success function is something like this, yes?

success: function(data) { // data represents here the ajax json response
  var days = data.day;
  var dates = data.date;
  // Here loop through them, or do anything else you like
}

Basically you can treat JSON responses just like any Javascript object.

分享给朋友:
您可能感兴趣的文章:
随机阅读: