location.reload() location.replace() location.hash = AnchorName location.hostname = HostName location.port = Port location.host = HostName location.pathname = Path location.protocol = Protocol location.search = Str URL = location.href AnchorName = location.hash HostName = location.hostname Port = location.port HostName = location.host Path = location.pathname Protocol = location.protocol Str = location.search |
リロード( 更新 ) ページの URL を変更 アンカーネームを設定 ホストネームを設定 ポートを設定 ホスト、ポートを設定 パスを設定 プロトコルを設定 受け渡す文字列を設定 URL を取得 アンカーネームを取得 ホストネームを取得 ポートを取得 ホスト、ポートを取得 パスを取得 プロトコルを取得 受け渡す文字列を取得 |
<FORM> <A HREF="#anchor">アンカー</A> <A HREF="../../index.html">Venom's HOME PAGE</A><BR><BR> <INPUT TYPE="BUTTON" VALUE="Reload" onClick="location.reload();"> <INPUT TYPE="BUTTON" VALUE="Replace" onClick="location.replace( 'links.html' );"> <INPUT TYPE="BUTTON" VALUE="Search" onClick="location.search='?search=hello'"> </FORM> <SCRIPT TYPE="text/JavaScript"> <!-- document.write( "URL : ", location.href, "<BR>" ); document.write( "Hash : ", location.hash, "<BR>" ); document.write( "HostName: ", location.hostname, "<BR>" ); document.write( "Port : ", location.port, "<BR>" ); document.write( "Host : ", location.host, "<BR>" ); document.write( "PathName: ", location.pathname, "<BR>" ); document.write( "Protocol: ", location.protocol, "<BR>" ); //--> </SCRIPT> |