A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.cdn.mozilla.net/en-US/docs/Web/API/Node/baseURI below:

Node: baseURI property - Web APIs

Node: baseURI property

Baseline Widely available

The read-only baseURI property of the Node interface returns the absolute base URL of the document containing the node.

The base URL is used to resolve relative URLs when the browser needs to obtain an absolute URL, for example when processing the HTML <img> element's src attribute or the xlink:href Deprecated or href attributes in SVG.

Although this property is read-only, its value is determined by an algorithm each time the property is accessed, and may change if the conditions changed.

The base URL is determined as follows:

  1. By default, the base URL is the location of the document (as determined by window.location).
  2. If it is an HTML Document and there is a <Base> element in the document, the href value of the first Base element with such an attribute is used instead.
Value

A string representing the base URL of the Node.

Examples Without <base>
<output>Not calculated</output>
const output = document.querySelector("output");
output.value = output.baseURI;
With <base>
<base href="https://developer.mozilla.org/modified_base_uri/" />
<output>Not calculated</output>
const output = document.querySelector("output");
output.value = output.baseURI;
Specifications Browser compatibility See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4