Questions tagged [onunload]

198 questions
0
votes
0 answers

Chrome onUnload event not triggering

I have set something in local storage (where tabId is the id of the triggering tab [onUpdated event]) var visited = {}; visited[tabId] = true; chrome.storage.local.set(visited); I then wish to change the stored variable to false when the page…
0
votes
0 answers

unload function listening to both refresh and close

I am trying to catch a event i.e. window close. So i used unload, but it catches both refresh and close. So my action gets triggered for both. Is there a way to catch only close event?
Hacker
  • 7,798
  • 19
  • 84
  • 154
0
votes
0 answers

object.onunload does not work properly in internet explorer

I was wondering why my codes works fine in chrome but it won't work in IE. I believe object.onunload works in IE too. function showPopup() { myPopup = window.open("", "", "dialogWidth:500px;dialogHeight:500px"); myPopup.onunload = function()…
Cille
  • 113
  • 1
  • 1
  • 7
0
votes
0 answers

Workaround for Firefox's lack of support of onUnload?

We have a chat client in our web app. When the user closes the window the chat is in, we provide a chance to cancel in the onBeforeUnload event $(window).on('beforeunload') = function(e) { return (e || window.event).returnValue = "Are you sure…
0
votes
1 answer

I want a form to be completed when the user exits the site

I have some code that gets the user to enter some information and I want that information to be submitted when the page is closed (just to be different) but at the moment, it only gets submitted if you say to stay on the page then exit the…
D.Drew
  • 1
0
votes
1 answer

Trying to send data cross domain on page exit with javascript

I have a script on multiple domains that are not mine which sends data to an AWS SQS queue on page exit. When I compare the number of times I receive data to the number of times that the script is loaded on the page I show that 57% of time I do not…
0
votes
0 answers

Mail or submit filled form data on page close or page unload

I want to submit or mail the fully filled or partially filled form data when the user closes the page or hit the back button of the browser. Is it possible to create such an environment using jQuery or JavaScript? I am not aware of onunload event or…
0
votes
2 answers

Javascript submit() event is not fired up on exit (unload event)

I got page where HTML elements
and '); document.write('
ritmas
  • 345
  • 1
  • 4
  • 9
0
votes
1 answer

Updating pouchDB when the page is closed

I am trying to update the DB when a user closes/reloads the page. I have tried all sort of combinations with "onunload", "onbeforeunload", and "onhide" but nothing works. Here's the code I would like to run when the page is closed: function…
Andre Hissa
  • 1
  • 1
  • 3
0
votes
1 answer

JavaScript save form on page unload

I'm trying to automatically save a form when leaving a page with JavaScript by using the following code $(window).unload( function() { $("#registration-patient-form").submit(); }); Yet, somehow the form does not get submitted and I'm simply…
ftramnitzke
  • 151
  • 9
0
votes
2 answers

Browser agnostic hook to send asynchronous request upon window.onunload

When a user closes a browser tab or window we want to implement a hook to send an http delete request. My question is - can window.onunload or window.onbeforeunload guarantee the sending of AJAX requests or is there no such guarantee? Now, we…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
0
votes
1 answer

Firefox Onunload After Onbeforeload

This javascript works in conjunction with php to display an ad to a user when they are attempting to leave the page (obnoxious functionality I know.. Not my choice). The desired order of events once the user tries leaving is: 1. Onbeforeunload:…
Lucas
  • 13
  • 5
0
votes
1 answer

Click a link on page unload event

I have multiple forms in one page, each of them with their unique save action. I want to implement an "auto-save" feature and my idea, when user navigates away without saving its form, it's to catch the page unload event and click on the existing…
0
votes
1 answer

AJAX POST to handler on unload not working after 60 seconds in ASP.NET

In ASP.NET I'm using jQuery AJAX on the page unload to POST to an http handler. This works as expected--AJAX fires as the page unloads... unless I remain on the page for longer than 60 seconds. After that, when the page is closed, the AJAX POST does…
Daniel Miller
  • 2,409
  • 4
  • 19
  • 20
0
votes
0 answers

How to check if my current processing request is completed in MVC?

I have a reporting web application in MVC. In one of the part, there is is file upload feature!! File upload is not made up as Modal pop up which disables everything in background but it's a simple view. I need to check the file load status if user…
user3323436
  • 71
  • 1
  • 5