Nasi wolontariusze nie przetłumaczyli jeszcze tego artykułu na język Polski. Dołącz do nas i pomóż go przetłumaczyć!
Można także przeczytać artykuł w języku: English (US).

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The Document.origin read-only property returns the document's origin. In most cases, this property is equivalent to document.defaultView.location.origin.

Syntax

var origin = document.origin;

Examples

var origin = document.origin; 
// On this page, returns:'https://developer.mozilla.org'

var origin = document.origin; 
// On "about:blank", returns:'null'

var origin = document.origin; 
// On "data:text/html,<b>foo</b>", returns:'null'

Specifications

Specification Status Comment
DOM
The definition of 'Document.origin' in that specification.
Living Standard Initial definition.
HTML Living Standard
The definition of 'origin for various objects (including Document objects)' in that specification.
Living Standard Initial definition.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
originChrome No support 41 — 71Edge ? Firefox No support NoIE Full support YesOpera Full support YesSafari ? WebView Android No support 41 — 71Chrome Android No support 41 — 71Edge Mobile ? Firefox Android No support NoOpera Android Full support YesSafari iOS ? Samsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown

See also

Autorzy i etykiety dokumentu

Ostatnia aktualizacja: mdnwebdocs-bot,