【发布时间】:2011-06-14 16:43:14
【问题描述】:
属于 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
}
【问题讨论】:
标签: javascript prototype-programming serverside-javascript