navigator.userAgent
ユーザーエージェント名を返します。ブラウザの判別を行うにはuserAgentプロパティを使って調べます。ただし、userAgentの文字列も自由に設定できるブラウザがあるため正確な判別を行うには限界があります。なお、Operaの場合はwindow.operaプロパティを調べることにより判別することができます。
構文
navigator.userAgent
例文
<html>
<head>
<title>navigator.userAgent</title>
<script type="text/javascript"><!--
window.onload = function() {
var txt = navigator.userAgent;
document.getElementById("result").innerHTML = txt;
}
// --></script>
</head>
<body>
<div id="result"></div>
</body>
</html>
関連記事
- navigator.vendorSub
- navigator.vendor
- navigator.userProfile
- navigator.userLanguage
- navigator.taintEnabled
- navigator.systemLanguage
- navigator.securityPolicy
- navigator.productSub
- navigator.product
- navigator.preference
- navigator.platform
- navigator.oscpu
- navigator.opsProfile
- navigator.onLine
- navigator.language
- navigator.javaEnabled
- navigator.cpuClass
- navigator.cookieEnabled
- navigator.browserLanguage
- navigator.appVersion
- navigator.appName
- navigator.appMinorVersion
- navigator.appCodeName
スポンサーリンク





