Javascript client side application.

Trying to eliminate memory leaks leads to ugly (to say the least) code.

I am trying to clean up in window.unload instead on messing up all the code trying to avoid them.

We use mostly `element.onevent=function(){..};` pattern, that results in closure (mostly wanted) and memory leak.

We do not use javascript frameworks.

Are there any ideas on how to clean up properly on exit?

Has anyone do the same or are you trying to avoid them?