There are several ways to reload the current page using a button or other trigger. The examples below use a button click to reload the page but you can use a text hyperlink or any trigger you like. The reload method in JavaScript is used to reload the webpage. The refresh button in your browser acts exactly like the reload method. If you call this method from anywhere in the web page, the web page will reload.
This code will create simple button with the text you want. When you click on the button, the JavaScript method will get executed by your browser and the entire page will reload.
Table of Contents
Reload/Refresh The Web-Page With Pure JavaScript:
There are many way to reload or refresh your page on user demand via pure JavaScript but here we are sharing the best three of them that are simple and have the full features and also working in old browser.
Way 1:
<input type="button" value="Reload Page" onClick="window.location.reload()">
Way 2:
<input type="button" value="Reload Page" onClick="history.go(0)">
Way 3:
<input type="button" value="Reload Page" onClick="window.location.href=window.location.href">
Note: You user browser should must allow JavaScript as some users block JavaScript in there browser to browse faster then there it will not work.
Last Words:
However, this need some div and java script knowledge you can protect your contents some how more encrypted box so any one can not easily steel. Be Blogger! Be Safer! Thank For Reading this guide.
thanks for the nice information in the post
Welcome here and thanks for liking our article. Stay with us to get more like this…