属于 JavaScript 对象原型(prototype)的回调函数如何访问对象成员? 回调不能关闭,一切都必须定义如下:
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 - 属于 JavaScript 对象原型(prototype)的回调函数可以访问对象成员吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6347009/