TOC PREV NEXT INDEX

Put your logo here!


location


Gets the URL of the current document.

Syntax

loc = document.location 

Parameters

loc is the URL as a string.

Example

dump(document.location); 
// returns a string like 
// http://www.peoplemagazine.com/juicybits.html 

Notes

document.location works the same as document.URL. Both are read-only properties unlike window.location, which can be set. Since the document object represents a single document or URL, its location cannot be changed.

Specification

DOM Level 0. Not part of specification.


mozilla.org | mailto:oeschger | bug 93108
TOC PREV NEXT INDEX