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
Post a Comment