I have this:
function test()
{
this.method = function ()
{
$("html").mousemove(function(event) {
console.log('~> moved');
});
}
this.method();
}
testInstance = new test();
testInstance = null; // delete window.testInstace;
Although I have removed references to the object by setting testInstance
to null (I've also tried deleting it as a property of window
), the mousemove event handler continues to operate and write to the console. If deleting the object that established the event handler doesn't remove it what then should I do to remove the event handler?