Location: reload() Methode

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

Die reload() Methode des Location Interfaces lädt die aktuelle URL neu, ähnlich wie die Aktualisieren-Schaltfläche.

Syntax

js
reload()

Parameter

forceGet Nicht standardisiert

Übergeben Sie true, um ein Neuladen zu erzwingen, das den Cache umgeht. Standardmäßig auf false. Nur in Firefox unterstützt.

Rückgabewert

Keiner (undefined).

Ausnahmen

SecurityError DOMException

Wird ausgelöst, wenn der Ursprung des Skripts, das die Methode aufruft, nicht der selbe Ursprung der Seite ist, die ursprünglich durch das Location Objekt beschrieben wird, meist wenn das Skript auf einer anderen Domain gehostet wird.

Beispiele

js
// reload the current page
window.location.reload();

Spezifikationen

Specification
HTML
# dom-location-reload-dev

Browser-Kompatibilität

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
reload

Legend

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

Full support
Full support
Partial support
Partial support
No support
No support
See implementation notes.
User must explicitly enable this feature.

Siehe auch