Bug Tracker

Modify

Ticket #8870 (closed bug: duplicate)

Opened 3 years ago

Last modified 2 years ago

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:
Blocking: Blocked by:

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

comment:1 Changed 3 years ago by timmywil

  • Component changed from unfiled to event

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

comment:2 Changed 3 years ago by timmywil

  • Priority changed from undecided to high
  • Status changed from new to open

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

comment:3 Changed 3 years ago by jwyles@…

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

comment:4 Changed 3 years ago by dmethvin

  • Status changed from open to closed
  • Resolution set to duplicate

comment:5 Changed 3 years ago by dmethvin

Duplicate of #10080.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.