How to reload the current page ?
The Window.location read-only property returns a Location object with information about the current location of the document.
Its optional unique parameter is a Boolean , which, when this method receives a true value as argument, it will cause the page to always be reloaded from the server. If it is false or not specified, the browser may reload the page from its cache.
- to get current page address (URL)
- to redirect the browser to another page
- to reload the same page
The location object is like a fragment of the window object and is called up through the window.location property.
location object has three methods:
- assign(): used to load a new document.
- reload(): used to reload current document.
- replace(): used to replace current document with a new one.