Document.origin - オリジン
originは、Documentのプロパティです。ドキュメントに関連付けられたオリジンを返します。
概要
- 名前
- origin
- 所属
- Document
- IDL
readonly attribute USVString origin;
- 仕様書
- https://dom.spec.whatwg.org/#dom-document-origin
説明
ドキュメントのオリジンを返す。オリジンが存在しない場合、nullを返す。
デモ
Document.originのデモです。
<!-- このコードは編集できます。 -->
<!DOCTYPE html>
<html>
<body>
<script>
var value = document.origin ;
console.log( value ) ;
document.body.appendChild( new Text( value ) ) ;
</script>
</body>
</html>
サポート状況
Chrome | Firefox | Safari | Edge | IE | Opera | iOS Safari | Android |
---|---|---|---|---|---|---|---|
● 41+ | 確認中 | ● 7.1+ | × | × | ● 28+ | ● 8.3+ | × |
関連記事
- Document()
- Document()は、Documentのコンストラクタです。新しいオブジェクトを作成します。
- Document.visibilityState
- visibilityStateは、Documentのプロパティです。最上位のブラウジングコンテキストが持つドキュメントの表示状態を文字列で返します。
- Document.activeElement
- activeElementは、Documentのプロパティです。フォーカス中の要素を返します。フォーカス中の要素がなければbody要素、それもなければhtml要素、それもなければnullを返します。
- Document.forms
- formsは、Documentのプロパティです。ドキュメントの全てのform要素を返します。