A RetroSearch Logo

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

Search Query:

Showing content from https://developer.mozilla.org/en-US/docs/Web/API/URL/origin below:

URL: origin property - Web APIs

URL: origin property

Baseline Widely available

Note: This feature is available in Web Workers.

The origin read-only property of the URL interface returns a string containing the Unicode serialization of the origin of the represented URL.

The exact structure varies depending on the type of URL:

For all other cases, the string "null" is returned.

Value

A string.

Examples
const url = new URL("blob:https://mozilla.org:443/");
console.log(url.origin); // 'https://mozilla.org'

const url = new URL("http://localhost:80/");
console.log(url.origin); // 'http://localhost'

const url = new URL("https://mozilla.org:8080/");
console.log(url.origin); // 'https://mozilla.org:8080'
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.3