This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

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