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.