Method 1: Using the location.reload(): The location.reload() method reloads the current web page emulating the clicking of the refresh button on the browser. The optional true parameter passed to the method is used to force the page to load from the server and ignore the browser cache.
Method 2: Using history.go(0): The history.go() method loads a URL from the browsers history depending on the parameter passed to it. If the parameter passed is ‘0’, it reloads the current page.
Method 3: Using location.replace with the current page: The location.replace() method can be used be passed with the location.pathname as a parameter. The location.pathname returns the current url and passing that on to location.replace() reloads the current page.
- Before clicking the button:
- After clicking the button:
- Refresh a page using PHP
- How to refresh parent page on closing a popup ?
- How to refresh a file in Node.js ?
- What’s the best way to reload / refresh an iframe?
- How to display search result of another page on same page using ajax in JSP?
- How to show Page Loading div until the page has finished loading?
- How to redirect a page to another page in HTML ?
- How to pass form variables from one page to other page in PHP ?
- How to jump to top of browser page using jQuery?
- How to get the size of screen, current web page and browser window using jQuery?
- How to scroll automatically to the Bottom of the Page using jQuery?
- How to click anywhere on the page except one element using jQuery ?
- How to get title of current HTML page using jQuery ?
- How to select all visible or hidden elements in a HTML page using jQuery ?
- How to scroll the page up or down using anchor element in jQuery ?
- How to redirect to a particular section of a page using HTML or jQuery?
- How to print a page using jQuery ?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.