javascript - Jquery event doesn't fire in any case -


so, here want alert true, when window closed ( mean particullary tab in browser).

$(document).ready(function(){    }); $(window).unload(function(){     alert('true'); }); 

tried $(window) inside $(document).ready(), nothing.

you're limited in can in context of window.unload. browsers won't let force user stay on page, , includes calling alert.

the best thing you're allowed return string onbeforeunload handler - browser display user, along question "are sure want leave page?"


Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -