When a page is unloaded, jQuery is not unbinding any bound events
causing a memory leak in IE6.
Below is a very simple test page. If it is opened in IE6 you can see
the memory usage skyrocket.
<HTML>
<HEAD>
<script type="text/javascript" src="http://
code.jquery.com/jquery-
latest.js"></script>
<script>
$(document).ready(function() {
// Bind an onClick event to the body
$("body").click(aFunction);
// Reload the page
window.location.reload();
});
function aFunction() {}
</script>
</HEAD>
<BODY>
</BODY>
</HTML>
If you add the code below into the page somewhere, the memory no
longer increases.
$(window).unload(function() {
$('*').unbind();
});
Can something similar to this be added to the jQuery library?