Back to Content

Navigation: transition property

files/en-us/web/api/navigation/transition/index.md

latest846 B
Original Source

{{APIRef("Navigation API")}}

The transition read-only property of the {{domxref("Navigation")}} interface returns a {{domxref("NavigationTransition")}} object representing the status of an in-progress navigation, which can be used to track it.

Value

A {{domxref("NavigationTransition")}} object, or null if no navigation is currently in progress.

Examples

js
async function handleTransition() {
  if (navigation.transition) {
    showLoadingSpinner();
    await navigation.transition.finished;
    hideLoadingSpinner();
  }
}

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also