]> source.dussan.org Git - jquery.git/commitdiff
No need to use the conditional comment for binding the onunload event in IE.
authorjeresig <jeresig@gmail.com>
Sat, 19 Dec 2009 01:29:22 +0000 (20:29 -0500)
committerjeresig <jeresig@gmail.com>
Sat, 19 Dec 2009 01:29:22 +0000 (20:29 -0500)
src/event.js

index b50a1ec4e0249c07c0f42f7cd2be81f890225e66..a2b512ae1b5f5071ba6c90cadd7b2390558d5e49 100644 (file)
@@ -882,15 +882,15 @@ jQuery.each( ("blur focus load resize scroll unload click dblclick " +
 // Window isn't included so as not to unbind existing unload events
 // More info:
 //  - http://isaacschlueter.com/2006/10/msie-memory-leaks/
-/*@cc_on
-window.attachEvent("onunload", function() {
-       for ( var id in jQuery.cache ) {
-               if ( jQuery.cache[ id ].handle ) {
-                       // Try/Catch is to handle iframes being unloaded, see #4280
-                       try {
-                               jQuery.event.remove( jQuery.cache[ id ].handle.elem );
-                       } catch(e) {}
+if ( window.attachEvent ) {
+       window.attachEvent("onunload", function() {
+               for ( var id in jQuery.cache ) {
+                       if ( jQuery.cache[ id ].handle ) {
+                               // Try/Catch is to handle iframes being unloaded, see #4280
+                               try {
+                                       jQuery.event.remove( jQuery.cache[ id ].handle.elem );
+                               } catch(e) {}
+                       }
                }
-       }
-});
-@*/
+       });
+}