属于 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 对象原型的回调函数如何访问对象成员?回调不能关闭,一切都必须定义如下:
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
}