A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://developer.mozilla.org/en-US/docs/Web/API/Navigation/reload below:

Navigation: reload() method - Web APIs

Navigation: reload() method

Limited availability

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The reload() method of the Navigation interface reloads the current URL, updating any provided state in the history entries list.

Syntax Parameters
options Optional

An options object containing the following properties:

state Optional

Developer-defined information to be stored in the associated NavigationHistoryEntry once the navigation is complete, retrievable via getState(). This can be any data type. You might, for example, wish to store a page visit count for analytics purposes, or store UI state details so the view can be shown exactly as the user last left it. Any data stored in state must be structured-cloneable.

info Optional

Developer-defined information to be passed along to the navigate event, made available in NavigateEvent.info. This can be any data type. You might, for example, wish to display newly-navigated content with a different animation depending on how it was navigated to (swipe left, swipe right, or go home). A string indicating which animation to use could be passed in as info.

Return value

An object with the following properties:

committed

A Promise which will fulfill when the visible URL has changed and a new NavigationHistoryEntry has been created.

finished

A Promise which will fulfill when all promises returned by the intercept() handler are fulfilled. This is equivalent to the NavigationTransition.finished promise fulfilling, when the navigatesuccess event fires.

Either one of these promises rejects if the navigation has failed for some reason.

Exceptions
DataCloneError DOMException

Thrown if the state parameter had values included in it that are not structured-cloneable.

Examples Using info and state
async function handleReload() {
  await navigation.reload({
    info: { animation: "fade-in" },
    state: { infoPaneOpen: true },
  }).finished;

  // Update application state
  // …
}

Reload page and add a new state item:

async function handleReload() {
  await navigation.reload({
    state: { ...navigation.currentEntry.getState(), newState: 3 },
  }).finished;

  // Update application state
  // …
}
Specifications Browser compatibility See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4