JavaScript Page Refresh Tutorial

In this section, we will learn what the location reload() method is and how to use it in JavaScript.

How to Refresh a Page in JavaScript: JavaScript Location reload() Method

The `reload()` method will cause the current document (the current URL in the browser window) to be reloaded.

Basically, using this method we can programmatically reload the currently opened webpage.

The method takes no-argument and there’s no return value.

Location reload() Method Syntax:

location.reload()

Location reload() Method Parameter:

The method does not take an argument.

Location reload() Method Return Value:

There’s no return value from this method.

Example: refresh a page in JavaScript

See the Pen refresh a page in JavaScript by Omid Dehghan (@odchan1) on CodePen.

Facebook
Twitter
Pinterest
LinkedIn

Top Technologies