.navigator

The .navigator object contains information about the visitor's browser:

<html>
	<head>
		<title>JavaScript</title>
	</head>
	<body>
		<h1>Browser Info:</h1>
		<p id="info"></p>
		<script>
			var browserInfo = "Browser CodeName: " + navigator.appCodeName + "<br>";
			browserInfo+= "Browser Name: " + navigator.appName + "<br>";
			browserInfo+= "Browser Version: " + navigator.appVersion + "<br>";
			browserInfo+= "Cookies Enabled: " + navigator.cookieEnabled + "<br>";
			browserInfo+= "Platform: " + navigator.platform + "<br>";
			browserInfo+= "User-agent header: " + navigator.userAgent + "<br>";
			browserInfo+= "User-agent language: " + navigator.systemLanguage + "<br>";
			document.getElementById("info").innerHTML=browserInfo;
		</script>
	</body>
</html>

Save & refresh browser:

Browser Info:

Browser CodeName: Mozilla
Browser Name: Netscape
Browser Version: 5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36
Cookies Enabled: true
Platform: Win32
User-agent header: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36
User-agent language: undefined

Leave a Reply