Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#8870 closed bug (duplicate)

Binding an event to an iframe window will throw an exception on unbind in ie

Reported by: jwyles@… Owned by:
Priority: high Milestone: 1.next
Component: event Version: 1.5.2
Keywords: Cc:
Blocked by: Blocking:

Description

When binding an event to a window other than the current will throw an exception on unbind of that event in ie8, as it attempts to delete off the window.

Pull request to fix the issue can be found at https://github.com/jquery/jquery/pull/324 Following code is a test case:

<!DOCTYPE html>
<html>
    <head></head>
    <body>
    <iframe name="test"> 
    </iframe>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.js"></script>
    <script>
        var testFrame = window.frames["test"],
            callback = function() { console.log("called"); };
        $(testFrame).bind('resize',callback);
        $(testFrame).trigger('resize');
        $(testFrame).unbind('resize',callback);
        $(testFrame).trigger('resize');
    </script>
    
    </body>
</html>

Change History (5)

comment:1 Changed 10 years ago by timmywil

Component: unfiledevent

I created a test case, but haven't checked it in IE8 yet. http://jsfiddle.net/timmywil/wHmw2/

comment:2 Changed 10 years ago by timmywil

Priority: undecidedhigh
Status: newopen

Confirmed. Believe it happens on delete cache[ id ] in removeData

comment:3 Changed 10 years ago by jwyles@…

It is in removeData, the fix and test case is on the pull request linked.

comment:4 Changed 10 years ago by dmethvin

Resolution: duplicate
Status: openclosed

comment:5 Changed 10 years ago by dmethvin

Duplicate of #10080.

Note: See TracTickets for help on using tickets.