Jump to content

obeforeunload Event-mobile


Recommended Posts

Here it is. It did not work on Safari or Chrome (iPhone). RecordAction() was tested with other events and it works.

window.onbeforeunload = function() {
var Expo = document.getElementById("exposure");
var ct = ConvertTime(Expo.currentTime);
var Action = " ClOSED the BROWSER WINDOW ON";
Edited by IndianaGuy
Link to comment
Share on other sites

I would start by testing with an alert() statement.


If your RecordAction() method is making an AJAX request which is asynchronous, then the browser may choose the leave the page before the request has been completed.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...