hostname

ホスト名とポート番号を返します。ポート番号が指定されている場合、FirefoxとiCab 3ではポート番号が削除された文字列を返します(ドメイン名のみ)。

構文

リンクオブジェクト.hostname

例文

<html>
 <head>
  <title>hostname</title>
  <script type="text/javascript"><!--
   window.onload = function() {
    var txt = document.links[0].hostname;
    document.getElementById("result").innerHTML = txt;
   }
  // --></script>
 </head>
 <body>
 <ul>
 <li><a href="http://www.openspc2.org:8080/index.html">OpenSpace</a>
 </ul>
 <div id="result"></div>
 </body>
</html>

関連記事

スポンサーリンク

DROP CLUSTER クラスターを削除する

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

上に戻る