location.host

ホスト名を返します。

構文

location.host

例文

<html>
 <head>
  <title>location.host</title>
  <script type="text/javascript"><!--
  window.onload = function () {
   document.getElementById("result").innerHTML = location.host;
  }
  // --></script>
 </head>
 <body>
 <div id="result"></div>
 </body>
</html>

関連記事

スポンサーリンク

文字列の部分一致検索を行う方法

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

上に戻る