Movatterモバイル変換


[0]ホーム

URL:


MDN Web Docs

Window: origin property

Theorigin read-only property of theWindow interface returns the origin of the global scope, serialized as a string.

Value

A string.

Examples

Executed from inside window scope, the following snippet will log the document's global scope's origin to the console.

js
console.log(window.origin); // On this page returns 'https://developer.mozilla.org'

If the origin is not a scheme/host/port tuple (say you are trying to run it locally, i.e., viafile:// URL),origin will return the string"null".

Specifications

Specification
HTML
# dom-origin-dev

Browser compatibility

See also

Help improve MDN

Learn how to contribute.

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp