One of the pages I'm working on at the moment is quite big, it has a huge amount of HTML elements and many of them have events bound to them. So whenever I navigate out of that page, there is a huge delay. The browser seems to be freezing during that time. And then it loads the next page (the page that I go to).
I notice that, this is because of the window unload event, which is specified in the source code at: jQuery( window ).bind( 'unload', function(){ for ( var id in jQuery.cache ) // Skip the window if ( id != 1 && jQuery.cache[ id ].handle ) jQuery.event.remove( jQuery.cache[ id ].handle.elem ); }); Is there anyway that we can speed up this event? Maybe in the next release of jQuery? This snippet seems to take too much time to run on large page. If there is not, can I just remove it? Why do we need this function? Sorry, I'm still new to JS, so I'm don't know why we need this, please advise. Thanks.