In my web application, I have a lot of javaScript functions which, as I leaned recently, leak memory because I�m creating closures, but I don�t understand how I can create DHTML without them. For example:
According to the articles I�ve read on the internet (one of them:
Memory Leak in IE, IE does not free up the memory for those objects because DOM objects
is referencing javaScript object �
� and function has the reference to the DOM object, so there is a circular reference.
In all the articles that I�ve read I can�t quite understand/find the solution to this problem. I think I saw a suggestion of declaring the function in the global scope and then assigning it to the element.onclick property, but doesn�t it still create a circular reference?
Can any one point me to the working solution?