我试图防止多个事件触发。
我正在使用回调函数来传递对象,如下所示:
function init() {
var myObj = this.someObject;
$('#id').bind("blur keyup change", function (e, obj) {
return function () {
SomeFunction(e, obj);
}
} (this, myObj));
}
function SomeFunction(e, obj) {
e.stopPropagation();
//do something with the object
}
错误是它找不到函数 stopPropagation。
这是因为我在调用函数中将“this”分配给了 e。
如何访问 SomeFunction 中的“事件”?