开发者

problem in accessing dojoAttachpoints

I have a js map which has dojoAttachpoints开发者_如何学编程 as keys .Now am iterating the map as follows

//errorMap holds dojoAttachpoints as keys for(var key in this.errorLableMap){ this.key.className = "ibm-error"; }

Am getting error saying this.key is undefined


You really should read up on your JavaScript. This is very elementary:

for(var key in this.errorLableMap){ key.className = "ibm-error"; }

this.key refers to the "key" property under the "this" object. key refers to the variable called "key". They are completely different things in JavaScript.

This is not Java.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜