How can I refresh a page with jQuery?
How can I refresh a page with jQuery?
Javascript
jQuery
refresh
reload
- asked 9 years ago
- B Butts
3Answer
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
- G John
location.reload();
Should work on all browsers even without jQuery
- answered 8 years ago
- Sunny Solu
Lots of ways will work, I suppose:
window.location.reload();
history.go(0);
window.location.href=window.location.href;
- answered 8 years ago
- Sunny Solu
Your Answer