Document.URL

  • Revision slug: DOM/document.URL
  • Revision title: document.URL
  • Revision id: 30363
  • Created:
  • Creator: Nickolay
  • Is current revision? No
  • Comment cross-reference document.documentURI; 25 words added, 13 words removed

Revision Content

{{ DomRef() }}

Summary

Returns the string URL of the HTML document.

Syntax

string = document.URL 

Notes

URL is a replacement for the DOM Level 0 document.location.href property. However, document.location.href is settable, and document.URL is not.

{{ domxref("document.documentURI") }} returns the same value and is available on non-HTML documents as well.

Specification

DOM Level 2 HTML: URL

{{ languages( { "es": "es/DOM/document.URL", "ja": "ja/DOM/document.URL", "pl": "pl/DOM/document.URL" } ) }}

Revision Source

<p>{{ DomRef() }}</p>
<h3 name="Summary">Summary</h3>
<p>Returns the string URL of the HTML document.</p>
<h3 name="Syntax">Syntax</h3>
<pre class="eval"><em>string</em> = document.URL 
</pre>
<h3 name="Notes">Notes</h3>
<p><code>URL</code> is a replacement for the DOM Level 0 <code>document.location.href</code> property. However, <code>document.location.href</code> is settable, and <code>document.URL</code> is not.</p>
<p>{{ domxref("document.documentURI") }} returns the same value and is available on non-HTML documents as well.</p>
<h3 name="Specification">Specification</h3>
<p><a class="external" href="http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-46183437">DOM Level 2 HTML: URL</a></p>
<p>{{ languages( { "es": "es/DOM/document.URL", "ja": "ja/DOM/document.URL", "pl": "pl/DOM/document.URL" } ) }}</p>
Revert to this revision