location.pathname
パス名を返します。
構文
location.pathname
例文
<html> <head> <title>location.pathname</title> <script type="text/javascript"><!-- window.onload = function () { document.getElementById("result").innerHTML = location.pathname; } // --></script> </head> <body> <div id="result"></div> </body> </html>
関連記事
- location.search
- location.replace
- location.reload
- location.protocol
- location.port
- location.href
- location.hostname
- location.host
- location.hash
- location.assign
スポンサーリンク