How to Reload the Page With JavaScript
by Gabi SolomonThere are a few ways you can reload a page with javascript. I will post them all below, and for demonstration i will put them as button onclick action.
Using location.reload
HTML:
-
<input onclick="window.location.reload()" type="button" value="Reload Page" />
Using history method
HTML:
-
<input onclick="history.go(0)" type="button" value="Reload Page" />
Using location.href
HTML:
-
<input onclick="window.location.href=window.location.href" type="button" value="Reload Page" />
Related Posts
-
oo

