最終更新:2012-02-10 (金) 16:16:04 (4459d)
window.location
Top / window.location
<script language="Javascript"> <!-- document.write("protocol = " + window.location.protocol + "<br>"); document.write("host = " + window.location.host + "<br>"); document.write("hostname = " + window.location.hostname + "<br>"); document.write("port = " + window.location.port + "<br>"); document.write("pathname = " + window.location.pathname + "<br>"); document.write("search = " + window.location.search + "<br>"); document.write("hash = " + window.location.hash + "<br>"); --> </script>
location.hash? | 現在ページURLのアンカーを取得する |
location.host? | 現在ページURLのホスト情報を取得する |
location.hostname? | 現在ページURLのホスト名を取得する |
location.href? | 現在ページURLを取得する |
location.pathname? | 現在ページURLのパス名を取得する |
location.port? | 現在ページURLのポート番号を取得する |
location.protocol? | 現在ページURLのプロトコルを取得する |
location.search | 現在ページURLのサーチ情報を取得する |
location.reload | ページをリロード(再読み込み)する |
location.replace | 指定したページへ移動する |