Location.reload()

JavaScript 1.1+, JScript 3.0+ Nav3+, IE 4+, Opera3+ Syntax

location.reload()

Description

The reload() method is used to reload the current page displayed in the browser.

Example

Listing 7.387 shows an example of how the reload() method is used.

Listing 7.387 Example of the reload() Method
<html>
<head>
<title> Using the reload method of the Location object</title>
</head>
<body>

<form name="form1">
Click the button to reload the current page.
<br><br>
Location.hash value: <input type="text" name="text1" size=20>
<br>
<input type="button" name="load" value="Reload page"
onClick='document.location.reload()'>
<br>
</form>

</body>
							
</html>
						

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.