How To Refresh Webpage Using JavaScript

Different ways to Refresh Webpage using JavaScript

Document API

The document interface represents any webpage loaded in the browser & serves as an entry point into the web page's content which is the DOM tree.


Windows API

The window interface represents a window containing a DOM document. The document property points to the DOM document loaded in that window. 


Refresh Using Button

We can create a button with the onClick attribute that will trigger the website reload as the reload() function is passed.

    Click to Refresh 

Using SetTimeout()

This method calls a function after several milliseconds.

setTimeout(() => {

History API

The DOM window object provides access to the browser's session history through the history object.