-
Notifications
You must be signed in to change notification settings - Fork 22.4k
/
index.md
45 lines (31 loc) · 1.5 KB
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
---
title: "NavigationTransition: navigationType property"
short-title: navigationType
slug: Web/API/NavigationTransition/navigationType
page-type: web-api-instance-property
status:
- experimental
browser-compat: api.NavigationTransition.navigationType
---
{{APIRef("Navigation API")}}{{SeeCompatTable}}
The **`navigationType`** read-only property of the
{{domxref("NavigationTransition")}} interface returns the type of the ongoing navigation.
## Value
An enumerated value representing the type of ongoing navigation.
The possible values are:
- `push`: A new location is navigated to, causing a new entry to be pushed onto the history list.
- `reload`: The {{domxref("Navigation.currentEntry")}} is reloaded.
- `replace`: The {{domxref("Navigation.currentEntry")}} is replaced with a new history entry. This new entry will reuse the same {{domxref("NavigationHistoryEntry.key", "key")}}, but be assigned a different {{domxref("NavigationHistoryEntry.id", "id")}}.
- `traverse`: The browser navigates from one existing history entry to another existing history entry.
## Examples
```js
console.log(navigation.transition.navigationType);
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- [Modern client-side routing: the Navigation API](https://developer.chrome.com/docs/web-platform/navigation-api/)
- [Navigation API explainer](https://github.com/WICG/navigation-api/blob/main/README.md)
- Domenic Denicola's [Navigation API live demo](https://gigantic-honored-octagon.glitch.me/)