PageTransitionEvent: PageTransitionEvent() constructor
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.
The PageTransitionEvent() constructor creates a new PageTransitionEvent object, that is used by the pageshow or pagehide events, fired at the window object when a page is loaded or unloaded.
Syntax
js
new PageTransitionEvent(type, options)
Parameters
type-
A string with the name of the event. It is case-sensitive and browsers set it to
pageshoworpagehide. optionsOptional-
An object that, in addition to the properties defined in
Event(), has the following property:persistedOptional-
A boolean indicating if the document is loading from a cache.
Return value
A new PageTransitionEvent object.
Specifications
| Specification |
|---|
| HTML> # the-pagetransitionevent-interface> |
Browser compatibility
Loading…