Linked Questions

1 vote
1 answer
3k views

I've less knowledge on JavaScript/JQuery I got snippet to get alert when i press browser 'X' button. code is below, window.onbeforeunload = function (e) { if(unsavedState){ e = e || window.event; ...
Rajesh Narravula's user avatar
2 votes
1 answer
1k views

I have a user progress data stored in the form that I submit at regular intervals or on certain sequence or exit button of app. The issue I am facing is if the user navigates through the app and then ...
Manmeet Bhurjee's user avatar
393 votes
12 answers
440k views

I need to warn users about unsaved changes before they leave a page (a pretty common problem). window.onbeforeunload = handler This works but it raises a default dialog with an irritating standard ...
flesh's user avatar
  • 23.9k
173 votes
17 answers
515k views

I want to capture the browser window/tab close event. I have tried the following with jQuery: jQuery(window).bind( "beforeunload", function() { return confirm("Do you really want ...
khelll's user avatar
  • 24.1k
59 votes
3 answers
101k views

I'm running a dialog box upon user leaving the page. The only thing is it runs for 1 sec and disappears? I know it has to do with bind('beforeunload'), but the dialog dies sooner than you can read ...
user154107's user avatar
20 votes
7 answers
85k views

Is there a way to detect tab close event to clear the localStorage. I need localStorage to share data across tabs. window.onbeforeunload event works fine but it has 2 issues for me: It also fires on ...
Vishal's user avatar
  • 11k
6 votes
3 answers
13k views

I have window.onbeforeunload triggering properly. It's displaying a confirmation box to ensure the user knows they are navigating (closing) the window and that any unsaved work will be erased. I ...
mirin's user avatar
  • 121
6 votes
1 answer
8k views

I am trying to override window.close() Method in JavaScript. Here is my code: (function () { var _close = window.close; window.close = function () { window.opener....
Rajesh Dhiman's user avatar
5 votes
3 answers
18k views

In this coding example the function logout() won't execute all it's async calls and won't wait till they are finished – instead page is unloading before, because the return of the beforeunload event ...
ScientiaEtVeritas's user avatar
5 votes
2 answers
4k views

Is there a annotation or something in spring-mvc which lets me call something as soon as a client closes connection or cancels a request in any way? I got a rest service which is normally very quick ...
Dennis Ich's user avatar
  • 3,795
0 votes
1 answer
4k views

I want to logout() user session when user leave website by closing web browser. I am using below code to display alert if user closes browser. Code:- $(window).bind('beforeunload', function () { ...
Bit_hunter's user avatar
0 votes
1 answer
3k views

On a page, I have a complex form (many fields, tabs...) and i want to show an alert message to warn the user if he tries to leave the page, wether he posted the form or not (because in a edit form, ...
Overdose's user avatar
  • 585
1 vote
1 answer
3k views

I'm creating online exam kind of application and in my app when user clicks on start button we are going to display timer for 3:00 minutes using setTimeout(func,3*60*1000) but when I refresh the ...
user1934044's user avatar
0 votes
2 answers
1k views

I am developing as MVC 5 application. I want store the users logout time in database. In my web page i have different Links (@Html.ActionLink). In my controller i have written code to store logout ...
Siddhesh Adarkar's user avatar
0 votes
0 answers
2k views

In my application I have to forcefully log out user when they close tab or browser.I have logout function and I want to call it when user closes tab/browser.I have tried this piece of code but it didn'...
dan's user avatar
  • 78

15 30 50 per page