複数のイベントが発生するのを防ごうとしています。
次のように、オブジェクトを渡すためにコールバック関数を使用しています。
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 の「イベント」にアクセスするにはどうすればよいですか?