Modify ↓
Ticket #4791 (closed bug: invalid)
$(childWindow).unload registers an unload handler for the owner window
| Reported by: | kevin | Owned by: | kevin |
|---|---|---|---|
| Priority: | major | Milestone: | 1.4 |
| Component: | event | Version: | 1.3.2 |
| Keywords: | unload | Cc: | |
| Blocking: | Blocked by: |
Description
Registering an unload handler on a child window doesn't work.
The handler instead is attached to the parent window.
<!doctype html>
<html>
<head>
<script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.js"></script>
<script>
function onclick() {
var childWindow = window.open('about:blank');
$(childWindow).unload(function() {alert('child window closed');});
}
</script>
</head>
<body>
<a href="javascript:onclick();">click</a>
</body>
</html>
Change History
comment:1 Changed 4 years ago by brandon
- Status changed from new to closed
- Resolution set to duplicate
comment:2 Changed 4 years ago by kevin
- Status changed from closed to reopened
- Resolution duplicate deleted
Reopening this--I can confirm that the fix in #4628 does not fix this issue.
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.

This was fixed with #4268