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

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

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -