This sample JavaScript code will help you to find the Browser level details using some standard JavaScript functions.
Sometime while coding we need to have browser details so that make programs browser compatible and your programs can rum on multiple browsers with out any error.
The best way is to handle all the browser related things in JavaScript. and user appropriate action at client side only.
So use this code and enjoy the power of JavaScript.
The navigator variable contains all the details of browser level.
navigator.appName returns the browser name.
navigator.appVersion gives the exact browser version details.
navigator.appCodeName returns the browser code
navigator.platform gives the browser code.
navigator.cookieEnabled gives the cookies are enabled or not in current browser.
<html>
<body>
<script type="text/javascript">
document.write("Browser Name: ")
document.write(navigator.appName + "<br>")
document.write("Version of Browser: ")
document.write(navigator.appVersion + "<br>")
document.write("Browser Code: ")
document.write(navigator.appCodeName + "<br>")
document.write("Platform / Os: ")
document.write(navigator.platform + "<br>")
document.write("Cookies Enabled: ")
document.write( navigator.cookieEnabled);
</script>
</body>
</html>
0 comments:
Post a Comment