作者washqwe (阿蹦)
看板Ajax
標題[問題] loop object property
時間Fri Dec 25 14:20:52 2015
http://i.imgur.com/cJXBszv.jpg
上圖最後只為一個image附值
需改為thestatus[thename] = 'normal'才可, 請問原因是
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 180.217.181.211
※ 文章網址: https://webptt.com/m.aspx?n=bbs/Ajax/M.1451024455.A.857.html
1F:→ rexyeah: 弄個迴圈總有個目的吧..看起來這個迴圈的目的是命名啊 12/25 15:05
2F:→ washqwe: 這只是舉例, 12/25 15:40
3F:推 eight0: object.property <=> object["property"] 12/25 17:07
4F:→ washqwe: 在這例不成立 12/25 21:44
5F:→ johnny94: 你確定theName這個變數的值等於theName? 12/27 22:28
7F:→ washqwe: 蓤隇 12/27 22:40
8F:推 eight0: theStatus.theName => theStatus["theName"] 12/28 02:30
9F:→ eight0: theStatus["theName"] 和 theStatus[theName] 的意義是不 12/28 02:30
10F:→ eight0: 一樣的唷 12/28 02:31