]> source.dussan.org Git - jquery.git/commitdiff
Fix for #1187, #1278 and #1279
authorBrandon Aaron <brandon.aaron@gmail.com>
Thu, 21 Jun 2007 19:21:56 +0000 (19:21 +0000)
committerBrandon Aaron <brandon.aaron@gmail.com>
Thu, 21 Jun 2007 19:21:56 +0000 (19:21 +0000)
src/event/event.js

index 623bcf32a7a2abc3ea2faa4b0d897fb48429f4f0..bea2cbac7c6a093b9705b60464e50f894870f07e 100644 (file)
@@ -148,7 +148,7 @@ jQuery.event = {
                        data.unshift( this.fix({ type: type, target: element }) );
 
                        // Trigger the event
-                       if ( (val = element.$handle.apply( element, data )) !== false )
+                       if ( jQuery.isFunction(element.$handle) && (val = element.$handle.apply( element, data )) !== false )
                                this.triggered = true;
 
                        if ( fn && val !== false && !jQuery.nodeName(element, 'a') )
@@ -577,7 +577,8 @@ jQuery.extend({
                                document.removeEventListener( "DOMContentLoaded", jQuery.ready, false );
                        
                        // Remove script element used by IE hack
-                       jQuery(window).load(function(){ jQuery("#__ie_init").remove(); });
+                       if( !window.frames.length ) // don't remove if frames are present (#1187)
+                               jQuery(window).load(function(){ jQuery("#__ie_init").remove(); });
                }
        }
 });
@@ -991,7 +992,7 @@ if (jQuery.browser.msie)
                        var els = global[type], i = els.length;
                        if ( i && type != 'unload' )
                                do
-                                       jQuery.event.remove(els[i-1], type);
+                                       els[i-1] && jQuery.event.remove(els[i-1], type);
                                while (--i);
                }
        });