2Answer
Use location.reload()
:
$('#something').click(function() {
location.reload();
});
The reload()
function takes an optional parameter that can be set to true
to force a reload from the server rather than the cache. The parameter defaults to false
, so by default the page may reload from the browser's cache.
- answered 8 years ago
- Sandy Hook
There are unlimited ways to refresh a page with JavaScript:
location.reload()
history.go(0)
location.href = location.href
location.href = location.pathname
location.replace(location.pathname)
-
location.reload(false)
- answered 8 years ago
- Gul Hafiz
Your Answer