W3cubDocs

/Web APIs

PageTransitionEvent: PageTransitionEvent() constructor

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.

Note: A web developer doesn't typically need to call this constructor, as the browser creates these objects itself when firing pageshow or pagehide events.

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 pageshow or pagehide.

options Optional

An object that, in addition to the properties defined in Event(), has the following property:

persisted Optional

A boolean indicating if the document is loading from a cache.

Return value

A new PageTransitionEvent object.

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
PageTransitionEvent 16 79 11 No 15 6 4.4 18 14 14 6 1.0

See also

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/PageTransitionEvent/PageTransitionEvent