Window location.assign()
Description
The assign()
method loads a new document.
See Also:
Note
The difference between assign() and replace():
replace() removes the current URL from the document history.
With replace() it is not possible to use "back" to navigate back to the original document.
Syntax
location.assign(URL)
Parameters
Parameter | Description |
URL |
Required. The URL of a page to navigate to. |
Return Value
NONE |
Browser Support
location.assign()
is supported in all browsers:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | Yes |