Window location.assign() method
- Previous page assign()
- Next page hash
- Go up one level Window Location
Definition and usage
assign()
Method to load a new document.
See also:
Difference between assign() and replace():
replace()
Remove the current URL from the document history.
Use replace()
Unable to navigate back to the original document using 'Back'.
Syntax
location.assign(URL)
Parameters
Parameters | Description |
---|---|
URL | Required. The URL of the page to navigate to. |
Return value
None.
Browser support
All browsers support location.assign()
:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support | Support |
- Previous page assign()
- Next page hash
- Go up one level Window Location