TOC PREV NEXT INDEX

domref



window.location


Gets/sets the location, or current URL, of the window object.

Syntax

url = window.location
 
window.location = url
 

Parameters

url is a string containing the URL for the specified location.

Example

function getNews() {
 
   window.location= "http://www.cnn.com";
 
}
 
// in html: <button onclick="getNews();">News</button>
 

Notes

None.

Specification

DOM Level 0. Not part of specification.
 


Netscape Communications
http://developer.netscape.com
TOC PREV NEXT INDEX