Dud*_*lul 2 javascript serverside-javascript prototype-programming
如何将属于JavaScript对象原型的回调函数访问对象成员?回调不能是闭包,一切都必须定义如下:
function Obji(param){
this.element = param;
}
Obji.prototype.func(){
database.get("someKey",this.cb);
}
Obji.prototype.cb(){
//here I would like to access this.element
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
387 次 |
| 最近记录: |