JavaScript Window location.replace()
JavaScript Window location.replace()
The replace() method is used for replacing the current document with a new one. It is similar to the assign() method but the main difference is that replace() method removes the current URL from the history list and we can not go back or navigate backward.
Syntax:-
Its syntax is:- location.replace(URL)
Further Explanation:-
Parameter | Description |
URL | Required. The URL of a page to navigate to. |