javascript/jquery open.window popup fires onunload after about:blank unloads
问题 Let's say I have a button that opens a popup with window.open(): <button id = "my-button">Open window</button> And I want to capture when this window closes. I use the following code: $('#my-button').on('click', function() { popup = window.open('http://www.google.com', 'my_popup', "width=800,height=600,scrollbars=no,resizable=yes,status=yes,toolbar=no,location=no,menubar=no"); $(popup.document).ready(function() { console.log('ready!'); $(popup).on('unload', function() { console.log('unloaded