Questions tagged [onunload]

198 questions
0
votes
3 answers

Save state using HTML5 Web SQL on window unload

I'm using the Web SQL API to store some information on a page; I'd like to save the state of the page when the user closes the page or navigates away, thus, I start with: window.onunload = function () { db.transaction(function (tx) { …
Grumdrig
  • 16,588
  • 14
  • 58
  • 69
0
votes
1 answer

onunload and onbeforeunload not triggered when location changes

How do I detect a window.location modification which is made between the tags? When I execute the below in the chrome console I get my console.log as expected. window.onbeforeunload = function(){ console.log("Before…
0
votes
1 answer

How to cascade JavaScript unloads to child windows?

I want to unload dependent pop-ups when the main window closes. Main window: var dependentWindows = []; function closeDependents(){ dependentWindows.forEach(function(dependent) { dependent.close(); …
Ken Otwell
  • 345
  • 3
  • 13
0
votes
1 answer

Browser sends http request BEFORE executing the "unload" handler

I just discovered the following (by setting up a number of breakpoints to both client-side and server-side code): If you have a window.onunload handler - it will execute AFTER the browser sends http-request to the new page. You navigate away to a…
Serge Shultz
  • 5,888
  • 3
  • 27
  • 17
0
votes
0 answers

Using onbeforeunload in angularjs

I have been trying to call a a logout service from whitin onunload or onbeforeunload window events. This is because I needed to logout upon closure of window or a tab. I set $window.onbeforeunload within the run() block. $window.onbeforeunload…
Joubin Z.
  • 91
  • 1
  • 5
0
votes
1 answer

Reading a cookie into textbox (Javascript)

I wrote a cookie to hold the value of txtFirstName on the unload event. This is done on the unload event so it can be written without the need for a submit button: Cookie Test it works only when refreshing the page or clink some link on the page and the page is actually unloading, but not when it's closing. why…
MartianMartian
  • 1,753
  • 1
  • 18
  • 26
0
votes
0 answers

capturing page unload javascript

I have a web application which makes file uploads. While users are uploading, they need to stay on the page so download can continue, and if they want to leave the page I give them a confirmation box asking if are they sure about leaving the page.…
Tolga Evcimen
  • 7,112
  • 11
  • 58
  • 91
0
votes
1 answer

C# WebPages : manage Exit events or quit with no user action server side

What is the better solution to manage Exit or Quit events when user exit to other pages with no action?. This event need to be raised only one time and be usefull to delete all temporary files or datas not stored after the abandon of this page. Is a…
user325558
  • 1,413
  • 5
  • 22
  • 35
0
votes
1 answer

WPF TabControl: Children unloaded when other tab is selected

Is it possible to prevent WPF TabControl from unloading the children of a TabItem when selecting an other tab? The problem I'm facing is similar to the one described here: WPF TabControl - Preventing Unload on Tab Change? The solution provided there…
devar
  • 95
  • 8
0
votes
1 answer

Javascript onunload form submit isn't submitting data

I currently have form that checks if a user has unsubmitted changes when they leave the page with a function called through the onunload event. Here's the function: function saveOnExit() { var answer = confirm("You are about to leave the page.…
holic87
  • 791
  • 2
  • 17
  • 29
0
votes
1 answer

how to use onunload/onbeforeunload to check when user leaves page. To know if message is read

I have understood that this is the most effective way to go about this but honestly I don't really understand it. I have made a chat/ messaging system that stores every message in a database table and displays them on the page ordered by when they…