我相信这是问题所在。
我有一些对象:
(function(){
var call_new_function = function(){
// do some stuff: but this is function is undefined when called from callback
}
var someObject = new Thing();
$(some_ele).click(function(){
var _this = this;
someObject.doSomething({
// some values are set up
},
callback: call_new_function.call(_this) <-- this throws an error of undefined
)
});
})
我的感觉超出了这里的范围: call_new_function 。这是关闭问题吗?