Another question, in jquery.js(include version 1.2.3, 1.2.6 etc.) why add this code: 1. // Prevent memory leaks in IE 2. // And prevent errors on refresh with events like mouseover in other browsers 3. // Window isn't included so as not to unbind existing unload events 4. jQuery(window).bind("unload", function() { 5. jQuery("*").add(document).unbind(); 6. });
This makes closing/refresh/navigate window more slow, especially the page is large(has many html elements). Why not "have a definite object in view"? Do necessary unbind operation. To say the least, wrap this code block with: if (ie) { 1. // Prevent memory leaks in IE 2. // And prevent errors on refresh with events like mouseover in other browsers 3. // Window isn't included so as not to unbind existing unload events 4. jQuery(window).bind("unload", function() { 5. jQuery("*").add(document).unbind(); 6. }); }