document.documentURI

  • Revision slug: Web/API/document.documentURI
  • Revision title: document.documentURI
  • Revision id: 471943
  • Created:
  • Creator: nehasharma
  • Is current revision? No
  • Comment

Revision Content

{{DomRef}}

Summary

Returns the document location as string. It is read-only per DOM4 specification.

Syntax

var string = document.documentURI;

Notes

HTML documents have a {{domxref("document.URL")}} property which returns the same value. Unlike URL, documentURI is available on all types of documents.

Specification

Revision Source

<div>
  {{DomRef}}</div>
<h2 id="Summary" name="Summary">Summary</h2>
<p>Returns the document location as string. It is read-only per DOM4 specification.</p>
<h2 id="Syntax" name="Syntax">Syntax</h2>
<pre class="syntaxbox">
<code>var string = document.documentURI;</code>
</pre>
<h2 id="Notes" name="Notes">Notes</h2>
<p>HTML documents have a {{domxref("document.URL")}} property which returns the same value. Unlike <code>URL</code>, <code>documentURI</code> is available on all types of documents.</p>
<h2 id="Specification" name="Specification">Specification</h2>
<ul>
  <li><a class="external" href="http://www.w3.org/TR/dom/">DOM4 (Working Draft)</a></li>
</ul>
Revert to this revision