作者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/cn.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