Document.URL (Property)

This is the actual URL that was loaded for the document.


DOM level - 1
JavaScript - 1.1
JScript - 3.0
Internet Explorer - 4.0
Netscape - 3.0
Opera - 3.0
Property/method value type:String primitive
JavaScript syntax:-myDocument.URL

Most of the time, the document.URL value will be the same as the window.location.href value. However if a server redirect happened, then document.URL will contain the actual page that was loaded while window.location.href will contain the requested URL.

This property should be used in place of the document.location property which used-top be a string but is now a reference to the same object as the window.location property.

See also:Document object, Document.location, Document.referrer, URL, Window.location

Property attributes: