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
location.reload();
Specifications
Specification | Status | Comment |
---|---|---|
HTML Living Standard The definition of 'Location.reload()' in that specification. |
Living Standard | No change from HTML5. |
HTML5 The definition of 'Location.reload()' in that specification. |
Recommendation | Initial definition. |
Browser compatibility
BCD tables only load in the browser
See also
- The
Location
interface it belongs to. - Similar methods:
Location.assign()
andLocation.replace()
.