Document: documentURI property

فهرست فصل‌ها دانلود آرشیوناشر

MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونه‌کد

{{ApiRef("DOM")}}

The **documentURI** read-only property of the {{domxref("Document")}} interface returns the document location as a string.

Value

A string.

Examples

HTML

html
<p id="urlText">
  URL:<br />
  <span id="url">URL goes here</span>
</p>

JavaScript

js
document.getElementById("url").textContent = document.documentURI;

Result

{{EmbedLiveSample("Examples", "100%", 100)}}

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • The {{domxref("document.URL")}} property which returns the same value.