Modify ↓
Ticket #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: | ||
| 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:2 Changed 2 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 2 years ago by jwyles@…
It is in removeData, the fix and test case is on the pull request linked.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

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