我有以下对象数据:
var js_images = {
"newborn_set01_01.jpg":{"filename":"newborn_set01_01.jpg","title":"First Pic","description":"First description..."},
"newborn_set01_02.jpg":{"filename":"newborn_set01_02.jpg","title":"Second Pic","description":"Second description"},
"newborn_set01_03.jpg":{"filename":"newborn_set01_03.jpg","title":"Third Pic","description":"Third description"}
};
我将如何做一些简单的事情,比如创建一个警报来显示描述newborn_set01_03.jpg
?
这显然不起作用:
alert(js_images.newborn_set01_03.jpg.description);