0

下面是我得到的json响应,

{
    "day": ["Thursday", "Friday", "Saturday", "Sunday"],
    "date": ["03-01-2012", "03-02-2012", "03-03-2012", "03-04-2012"]
}

我想以不同的方式解析它的日期和日期。

4

1 回答 1

3

成功函数是这样的,是吗?

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
}

基本上,您可以像对待任何 Javascript 对象一样对待 JSON 响应。

于 2012-06-26T11:56:56.750 回答