Made the IE frameElement check more explicit. Fixes #3880.
[jquery.git] / src / event.js
index 405e19f..e46e108 100644 (file)
@@ -545,7 +545,7 @@ jQuery.fn.extend({
        
        live: function( type, fn ){
                var proxy = jQuery.event.proxy( fn );
-               proxy.guid += this.selector;
+               proxy.guid += this.selector + type;
 
                jQuery(document).bind( liveConvert(type, this.selector), this.selector, proxy );
 
@@ -553,22 +553,30 @@ jQuery.fn.extend({
        },
        
        die: function( type, fn ){
-               jQuery(document).unbind( liveConvert(type, this.selector), fn ? { guid: fn.guid + this.selector } : null );
+               jQuery(document).unbind( liveConvert(type, this.selector), fn ? { guid: fn.guid + this.selector + type } : null );
                return this;
        }
 });
 
 function liveHandler( event ){
        var check = RegExp("(^|\\.)" + event.type + "(\\.|$)"),
-               stop = true;
+               stop = true,
+               elems = [];
 
        jQuery.each(jQuery.data(this, "events").live || [], function(i, fn){
-               if ( !event.isImmediatePropagationStopped() && check.test(fn.type) ) {
+               if ( check.test(fn.type) ) {
                        var elem = jQuery(event.target).closest(fn.data)[0];
-                       if ( elem && fn.call(elem, event, fn.data) === false )
-                               stop = false;
+                       if ( elem )
+                               elems.push({ elem: elem, fn: fn });
                }
        });
+
+       jQuery.each(elems, function(){
+               if ( !event.isImmediatePropagationStopped() &&
+                       this.fn.call(this.elem, event, this.fn.data) === false )
+                               stop = false;
+       });
+
        return stop;
 }
 
@@ -630,7 +638,7 @@ function bindReady(){
 
                // If IE and not an iframe
                // continually check to see if the document is ready
-               if ( document.documentElement.doScroll && !window.frameElement ) (function(){
+               if ( document.documentElement.doScroll && typeof window.frameElement === "undefined" ) (function(){
                        if ( jQuery.isReady ) return;
 
                        try {