window.location.assign
Summary
Navigate to a new page.
Method of apis/locationapis/location
Syntax
var = window.location.assign(url);
Parameters
url
- Data-type
- String
The new URL to navigate to.
Return Value
Returns an object of type
Examples
Navigate to example.org.
window.location.assign("http://example.org/");
The assign
method is synonymous with replacing the window.location
object with a string.
window.location = "http://example.org/";
Related specifications
- Window Object 1.0
- W3C Working Draft