0

We have a web application which accepts requests from WEB(browser)/WAP(mobile). As part of app we will display a jsp page for taking user consent. If user closes browser we need to update in db as "BROWSER TERMINATED" and redirect.

The above case is working fine with desktop/laptop. We have used jQuery's beforeunload event for identifying the tab/browser closing.

When we test the webapp in mobile the jsp is getting displayed. When the user presses the back in mobile the beforeunload event is not getting triggered. Hence, our code is not updating in db.

As an alternative I tried with jQuery mobile's pagehide event. But that too not working. Any alternative for this. Please, suggest.

emerson.marini
  • 9,331
  • 2
  • 29
  • 46
  • Possible duplicate of [Is there any way to use window.onbeforeunload on Mobile Safari for iOS devices?](http://stackoverflow.com/questions/4127621/is-there-any-way-to-use-window-onbeforeunload-on-mobile-safari-for-ios-devices) – emerson.marini Jun 15 '16 at 12:55
  • Possible duplicate of [Is the onbeforeunload event not supported on iPhone?](http://stackoverflow.com/questions/6903457/is-the-onbeforeunload-event-not-supported-on-iphone) – emerson.marini Jun 15 '16 at 12:56
  • Possible duplicate of [Crossbrowser onbeforeunload?](http://stackoverflow.com/questions/7389554/crossbrowser-onbeforeunload) – emerson.marini Jun 15 '16 at 12:57

0 Answers0