How do I iterate through this JSON object in jQuery?

后端 未结 4 2132
自闭症患者
自闭症患者 2020-12-07 22:53

I have a JSON object which is generated by PHP. It\'s an object with a set of dates. It has the timeStamp and then a formatted version of the date. How would I iterate throu

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-07 23:03

    You can simply iterate through the json structure using jQuery each:

    $.each(data, function(index, element) {
       alert(element.dates.timeStamp); 
    });
    

提交回复
热议问题