Display Browser information using javascript
Q. Write a program using Java script for Web Page to display browsers information.
Ans.
<!DOCTYPE>
<html>
<head>
<title>Browsers information</title>
<script language=javascript>
function showBrowserinfo()
{
document.write("<b>Web Page to display browsers information</b> <br><br>");
document.write("Name "+navigator.appName+"<br>");
document.write("Version "+navigator.appVersion +"<br>");
document.write("Codename " +navigator.appCodeName +"<br>");
document.write("Cookie enable"+navigator.cookieEnabled +"<br>");
document.write("Java Enable"+navigator.javaEnabled +"<br>");
document.write("Mime type"+navigator.mimeTypes +"<br>");
document.write("Platform"+navigator.platform +"<br>");
document.write("Plug ins"+navigator.plugins +"<br>");
document.write("System Language"+navigator.systemLanguage +"<br>");
document.write("User language"+navigator.userAgent +"<br>");
document.write("User Agent"+navigator.userAgent +"<br>");
}
</script>
</head>
<body>
<h1>Web Page to display browsers information</h1>
<form id="form1">
<div>
<input id="Button1" type="button" value="Click me" onclick="showBrowserinfo()" />
</div>
</form>
</body>
</html>
INFO@
Here’s a table of all the parsed properties:
Property Description
browser.family Browser’s name
browser.name Browser’s name and version number
browser.version Browser’s full version
browser.major Browser’s major version number
browser.minor Browser’s minor version number
browser.patch Browser’s patch number
device.family Device name
device.name Device name and version
device.version Device full version
device.major Device’s major version number
device.major Device’s minor version number
device.patch Device’s patch number
device.type Type of device (e.g. “Desktop” or “Mobile”)
device.manufacturer Manufacturer of the device
os.family Operating system name
os.name Operating system name a full version
os.version Operating system’s full version
os.major Operating system’s major version number
os.minor Operating system’s minor version number
os.patch Operating system’s patch number
Comments
Post a Comment