Javascript examples for Browser Object Model:Location
The reload() method reloads the current document, which does the same as the reload button in your browser.
reload() method reloads the page from the cache, to force it to reload the page from the server use location.reload(true).
Parameter | Type | Description |
---|---|---|
forceGet | Boolean | Optional. |
Specifies the type of reloading:
No return value
The following code shows how to Reload the current document:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Reload page</button> <script> function myFunction() {/*from w w w. j a v a 2 s. co m*/ location.reload(); } </script> </body> </html>