Name
PageTransitionEvent — event object for pageshow and pagehide events
Inherits from
Event
Synopsis
Browsers fire a pageshow event after the load event when a
document first loads, and then fire another pageshow event each time
the page is restored from the in-memory history cache. A
PageTransitionEvent object is associated with each pageshow event,
and its persisted
property is
true
if the page is being
restored rather than loaded or reloaded.
Pagehide events also have an associated PageTransitionEvent
object, but the persisted
property is always true
for
pagehide events.
Pageshow and pagehide events are triggered on the Window object. They do not bubble and have no default action to cancel.
Properties
readonly boolean
persisted
For pageshow events, this property is
false
if the page was loaded (or reloaded) from the network or the disk cache. It istrue
if the page being shown was restored from the in-memory cache without being reloaded.For pagehide events, this property is always
true
.
Get JavaScript: The Definitive Guide, 6th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.