location.reload()

We can refresh any page by using location object like this.
location.reload();
We will try to explore how different ways we can refresh page by using location object.
Refreshing page using a button
We can use onclick event of a button to reload the page like this.
<input type="button" name="btn" value="Refresh" onclick="window.location.reload();";>
Here is the demo

You can move to previous page by using Back button

Refreshing child window

Same way we can refresh a child window ( from the parent window ) by clicking a button.
<input type="button" name="btn" value="Refresh" onclick="tm.window.location.reload();tm.focus();";>
You can read more on how to refresh parent window from child window here.
JavaScript location Getting hostname Full URL
Subscribe to our YouTube Channel here



plus2net.com










We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
©2000-2025   plus2net.com   All rights reserved worldwide Privacy Policy Disclaimer