Document.referrer - リファラー
referrerは、Documentのプロパティです。ドキュメントに関連付けられているリファラーを返します。
概要
- 名前
- referrer
- 所属
- Document
- IDL
readonly attribute USVString referrer;
- 仕様書
- https://html.spec.whatwg.org/multipage/dom.html#dom-document-referrer
説明
リファラーを返す。ない場合は空の文字列を返す。読み取り専用なので、値を代入して変更することはできない。
デモ
Document.referrerのデモです。他のページから、このページにアクセスしてみて下さい。
<!DOCTYPE html>
<html>
<body>
<script>
var value = document.referrer ;
console.log( value ) ;
document.body.appendChild( new Text( value ) ) ;
</script>
</body>
</html>
サポート状況
Chrome | Firefox | Safari | Edge | IE | Opera | iOS Safari | Android |
---|---|---|---|---|---|---|---|
● | ● | ● | ● | ● | ● | ● | ● |
関連記事
- Document()
- Document()は、Documentのコンストラクタです。新しいオブジェクトを作成します。
- Document.visibilityState
- visibilityStateは、Documentのプロパティです。最上位のブラウジングコンテキストが持つドキュメントの表示状態を文字列で返します。
- Document.activeElement
- activeElementは、Documentのプロパティです。フォーカス中の要素を返します。フォーカス中の要素がなければbody要素、それもなければhtml要素、それもなければnullを返します。
- Document.forms
- formsは、Documentのプロパティです。ドキュメントの全てのform要素を返します。