我以前用
MyClass.prototype.myMethod1 = function(value) {
this._current = this.getValue("key", function(value2){
return value2;
});
};
如何在回调函数中访问 this 的值,如下所示?
MyClass.prototype.myMethod1 = function(value) {
this.getValue("key", function(value2){
//ooopss! this is not the same here!
this._current = value2;
});
};