location: reload() method
The location.reload()
method reloads the current URL, like the Refresh button.
The reload may be blocked and a SECURITY_ERROR
DOMException
thrown. This happens if the origin of the script calling location.reload()
differs from the origin of the page that owns the Location
object. See Same-origin policy for more information.
Syntax
Parameters
forceGet
Non-standard
-
Pass true
to force a reload bypassing the cache. Defaults to false
. Only supported in Firefox.
Return value
Specifications
Browser compatibility
|
Desktop |
Mobile |
|
Chrome |
Edge |
Firefox |
Internet Explorer |
Opera |
Safari |
WebView Android |
Chrome Android |
Firefox for Android |
Opera Android |
Safari on IOS |
Samsung Internet |
reload |
1 |
12Before Edge 79, if a page added to Trusted Sites contains a cross-origin iframe, then calling reload() from within the iframe reloads the trusted page (in other words, the top page reloads, not the iframe).
|
1 |
5.5If a page added to Trusted Sites contains a cross-origin iframe, then calling reload() from within the iframe reloads the trusted page (in other words, the top page reloads, not the iframe).
|
3 |
1 |
4.4 |
18 |
4 |
10.1 |
1 |
1.0 |
See also