JavaScript ドキュメントの情報を取得する
documentオブジェクトが記述してあるHTMLファイルの情報を取得するプロパティです。「title」プロパティはHTMLの<title>部分の値を、「URL」プロパティはHTMLファイル自身のURLの値を、「referrer」プロパティはプロパティはHTMLファイルがリンクされていたURLの値を、それぞれ持っています。
- プロパティ:document.title
- プロパティ:document.URL
- プロパティ:document.referrer
document.writeln("タイトル:",document.title);
document.writeln("<br>");
document.writeln("URL:",document.URL);
document.writeln("<br>");
document.writeln("リンク元のURL:",document.referrer);
