NavigationDestination: index-Eigenschaft

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Experimentell: Dies ist eine experimentelle Technologie
Überprüfen Sie die Browser-Kompatibilitätstabelle sorgfältig vor der Verwendung auf produktiven Webseiten.

Die index-Schreibgeschützte Eigenschaft der NavigationDestination-Schnittstelle gibt den index-Wert des Ziel-NavigationHistoryEntry zurück, wenn der NavigateEvent.navigationType traverse ist, oder -1 sonst.

Wert

Eine Zahl, die den index des Ziel-NavigationHistoryEntry darstellt, oder -1.

Beispiele

js
navigation.addEventListener("navigate", (event) => {
  console.log(event.destination.index);
});

Spezifikationen

Specification
HTML
# the-navigationdestination-interface:dom-navigationdestination-index-2

Browser-Kompatibilität

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
index
Experimental

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.
See implementation notes.

Siehe auch