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
reload()
Parameter
forceGet
Nicht standardisiert-
Übergeben Sie
true
, um ein Neuladen zu erzwingen, das den Cache umgeht. Standardmäßig auffalse
. 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
// reload the current page
window.location.reload();
Spezifikationen
Specification |
---|
HTML # dom-location-reload-dev |
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | server | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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
- Das
Location
Interface, zu dem es gehört. - Ähnliche Methoden:
Location.assign()
undLocation.replace()
.