Class PopStateEvent
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
PopStateEvent is an interface for the Windowpopstate event.
[Value("PopStateEvent")]
public class PopStateEvent : Event
- Inheritance
-
PopStateEvent
- Inherited Members
Remarks
A popstate event is dispatched to the window every time the active history
entry changes between two history entries for the same document. If the history entry
being activated was created by a call to history.pushState() or was
affected by a call to history.replaceState(), the popstate
event's state property contains a copy of the history entry's state object.
-popstate event
-hashchange event
Constructors
PopStateEvent()
public PopStateEvent()
PopStateEvent(string, PopStateEventInit)
The PopStateEvent() constructor creates a new PopStateEvent object.
public PopStateEvent(string type, PopStateEventInit eventInitDict = null)
Parameters
typestringeventInitDictPopStateEventInit
Remarks
NOTE
A web developer doesn't typically need to call this constructor, as the browser creates these objects itself when firing Windowpopstate events.
-PushState(dynamic, string, string?)
-ReplaceState(dynamic, string, string?)
-Windowpopstate event
Properties
HasUAVisualTransition
The hasUAVisualTransition read-only property of the PopStateEvent interface returns true if the user agent performed a visual transition for this navigation before dispatching this event, or false otherwise.
[Value("hasUAVisualTransition")]
public bool HasUAVisualTransition { get; }
Property Value
- bool
A boolean value.
Remarks
User agents may provide a built-in visual transition when executing site navigations. If the site author also adds a visual transition, user agent and author transitions may conflict and confuse a visitor. The property lets you detect whether a UA transition was provided so that you can skip author transitions for a better user experience.
-Modern client-side routing: the Navigation API
-Navigation API explainer
-Same-document view transitions for single-page applications
State
The state read-only property of the PopStateEvent interface represents the state stored when the event was created.
[Value("state")]
public dynamic State { get; }
Property Value
- dynamic
An object, or
null.
Remarks
Practically it is a value provided by the call to PushState(dynamic, string, string?) or ReplaceState(dynamic, string, string?)
-PopStateEvent constructor
-State