File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Android and the fly likes onunload behavior Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "onunload behavior" Watch "onunload behavior" New topic

onunload behavior

Rana Dey

Joined: Jul 05, 2012
Posts: 10
We have a webpage (let's say webpage 1) having multiple divs, which displays based on user operations.

On browser back operation, the page webpage1 is being redirected to another page webpage2. For this we are getting page onunload event.

This page receives this onunload operation multiple times i.e. for all the divs which were loaded previously. That is, if on webpage1, div1, div2, div3, div4 being accessed by user previously. and if he presses back button when div4 was open on webpage1 then we observe div4 --> (back operation)--> div3 --> (back operation)-->div2 --> (back operation)-->div1--> (back operation)--> onunload event received for div1 --> onunload event received for div2-->onunload event received for div3 --> onunload event received for div4 --> redirection to webpage1.

Why its happening? Any clue please. This behavior is on Android mobile browser.

I agree. Here's the link:
subject: onunload behavior
It's not a secret anymore!