navigator.appName

アプリケーション名を返します。実際には正しいアプリケーション名が返されず、過去の互換性のためNetscapeの文字列を返すブラウザが多くあります。このため、ブラウザの判別を行うにはブラウザ独自のプロパティの存在を調べるか(例:window.opera)、userAgentプロパティを使って調べる必要があります(userAgentの文字列も自由に設定できるブラウザがあるため正確な判別は限度があります)。

構文

navigator.appName

例文

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

関連記事

スポンサーリンク

rename()を実行すると『Operation not permitted』とエラーが表示される

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

上に戻る