• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

onunload behavior

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 know this defies the law of gravity... but I never studied law." -B. Bunny Defiant tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic