October 20, 2005
Open Windows Task Manager (Ctrl-Shift-Esc) activate Performance tab and reload (F5) the page a few times. You will not see the memory rising.
Click Me!
Code:
function attach()
{
var element = document.getElementById("my-element");
element.attachEvent("onclick", clickHandler.closure(element));
// Make sure we see the leak
element.bigString = new Array(1000).join(new Array(1000).join("XXXXX"));
}
function clickHandler()
{
alert("Clicked: " + this.innerHTML);
}