I want to show an alert box on the beforeunload
event. I am using the following code for that.
Problem with this, is that it does not show an alert box on this event.
$(window).bind('beforeunload', function() {
alert($(location).attr('hostname'));
});
How can this problem be resolved?