Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
下面是我得到的json响应,
{ "day": ["Thursday", "Friday", "Saturday", "Sunday"], "date": ["03-01-2012", "03-02-2012", "03-03-2012", "03-04-2012"] }
我想以不同的方式解析它的日期和日期。
成功函数是这样的,是吗?
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 响应。