Question

How can I refresh / reload a page with JavaScript?

2 Answers

Use the location.reload() function to reload the current page. It does the same as the browser's reload button.

It accepts an optional parameter that defaults to false. The value false reloads the page from the browser's cache. If you set it to true, it forces the page's reload from the server.


This one worked for me: window.location.href=window.location.href;