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.
精彩评论