5
วิธีรับค่าออบเจ็กต์ JSON หากชื่อมีจุด?
ฉันมีอาร์เรย์ JSON ที่เรียบง่ายมาก (โปรดเน้นที่วัตถุ"point.bean.pointsBase" ): var mydata = {"list": [ {"points.bean.pointsBase": [ {"time": 2000, "caption":"caption text", duration: 5000}, {"time": 6000, "caption":"caption text", duration: 3000} ] } ] }; // Usually we make smth like this to get the value: var smth = mydata.list[0].points.bean.pointsBase[0].time; alert(smth); // should display 2000 แต่น่าเสียดายที่มันไม่แสดงอะไรเลย เมื่อฉันเปลี่ยน"points.bean.pointsBase" …
109
javascript
json
arrays
object