I am using jQuery bind:
$(window).bind('beforeunload', function() {
//code
return "";
}
If I do not give return "", it works fine in mozilla firefox, IE8. It does not give an alert box saying "Are you sure you want to navigate away from this page?" However in google chrome, beforeunload event does not work without return "" statement.
And if I use return"", it gives an alert box in all broswers.
I do not want the dialog box and I want beforeunload event to work. Please help. Please suggest if there is any other alternative solution to this. Thanks.