I’m seeing a memory leak in IE8/7 when binding custom events to a Jquery DOM object which is referenced in a JS object. IE9 seems fine. Using a standard event (‘click’) works fine as well.
Full code at http://jsfiddle.net/hah8n/1/
var testField = function ($in) {
var $input = $in;
var onCustom = function () { }
this.Test = function () {
$input.on('custom', onCustom);
}
}
var $input = $("<span>" + Math.random() + "</span>").appendTo($row);
new testField($input).Test();
In the JSFiddle I also added clean-up code as a solution maybe – but it doesn’t help. Also storing all instances of “testField” somewhere and then later deleting them (using “delete” command) did not help.
Any ideas, maybe some insights on custom events and special treatment in IE8?
Jquery 1.8b2 seems to fix this. 🙂