How to reload the current page with JavaScript

published: 19 May 2022

2 min read

How to reload the current page with JavaScript

In JavaScript, the reload() method of the Location object is used to reload the current web page.

Here is an example:

location.reload();

You can also pass an optional boolean parameter to reload() to force the browser to reload the page from the server:

location.reload(true);

If you pass the false value or skip it entirely, the browser may reload the page from its cache.

Take a look at JavaScript location object tutorial to learn more about the Location object properties and methods.

How to reload the current page with JavaScript | Coding Tips And Tricks

Are we missing something?  Help us improve this article. Reach out to us.

Are you looking for other code tips?

Check out what's on in the category: javascript, programming
Check out what's on in the tag: javascript, programming