HTML5 has a pageshow event. In what instances does it work differently than the body's onload
handler?
Asked
Active
Viewed 2,359 times
3
![](../../users/profiles/4370109.webp)
Brian Tompsett - 汤莱恩
- 5,195
- 62
- 50
- 120
![](../../users/profiles/64421.webp)
Ben McCann
- 16,431
- 22
- 74
- 96
2 Answers
1
The pageshow event fires every time the page is loaded whereas the load event doesn’t fire in Firefox 1.5 when the page is loaded from cache.
![](../../users/profiles/64421.webp)
Ben McCann
- 16,431
- 22
- 74
- 96
0
In addition to the answer above, there is a far more important difference between the two.
According to my test on iOS, if you load a local page from a WkWebView
, hit a link to jump to another page and use the goBack
function to go back the previous page, only onpageshow
will fire, onload
will not.
![](../../users/profiles/812034.webp)
Earth Engine
- 9,100
- 4
- 41
- 68