Using the history object
We can refresh the current page using the method go() of the browser’s history object.
<input type="button" value = "Refresh" onclick="history.go(0)" />
Using the method window.location.reload()
We can refresh the current page using the method reload() of the window.location object.
location.reload(); //OR window.location.reload();
Define the meta tag
We can also set the http-equiv meta tag which will automatically refresh the page at a given interval.
<meta http-equiv="refresh" content="1">
This will reload the page after a second. Here
content="1" is equal to 1 second.
MCQPractice competitive and technical Multiple Choice Questions and Answers (MCQs) with simple and logical explanations to prepare for tests and interviews.Read More