How to use Navigator Object in JavaScript
In this article I am going to explain about Navigation object in JavaScript.
JavaScript Navigator Object
JavaScript Navigator object contain information about browser application. Its can be use for get any type of information about browser.
Syntax // Syntax for get browser name
Example // This example will display version info
<html>
<head>
<script type="text/javascript">
function Myfun() {
document.write("Version info: " + navigator.appVersion);
}
</script>
</head>
<body>
<button onclick="Myfun()">
click me</button>
</body>
</html>
|
Output
Example // This example will display browser name
<html>
<head>
<script type="text/javascript">
function Myfun() {
document.write("Name: " + navigator.appCodeName);
}
</script>
</head>
<body>
<button onclick="Myfun()">click me</button>
</body>
</html>
|
Output
You may also want to read these related articles: here
Ask Your Question
Got a programming related question? You may want to post your question here