The syntax for the reload function is:
This function doesn’t return any parameters. But we can pass true or false. In the case of true, the web page must have to be reloaded from the webserver. Otherwise, for false, the web page is supposed to be reloaded from the cache of the web browser.
Let’s take a look at the examples and learn in a better way.
First, if we simply call the function. It will definitely reload the page.
And if we pass true, it will reload the page from the webserver.
And if we pass false, it will reload the web page from the browser’s cache.
We can also reload the page using a function and the onclick event of a button. First, create a button with the onclick event in the HTML file.
And in the script file, the function should be like this.