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>

関連記事

スポンサーリンク

CPUやストレージの温度を調べる方法(CPU HDD SSD NVMe)

ホームページ製作・web系アプリ系の製作案件募集中です。

上に戻る