×

Html & Html5

it training classes Logo

The World's best Software Development Study Portal

Js Navigator Object



For the browser detection Js navigator object is used. We can get the browser information like as appName, appCodeName etc. This information which we can get only through browser, we can accessed these by navigator object

Let's understand some examples below

<html>

<body>

<script>

       document.getElementById('check').innerHTML = navigator.appCodeName;

  }

</script>

<button type="button" id="btnid" onclick="visitedurl()> Click Here </button>

<p id="check"> </p>

</body>

</html>

Output of this program




Some properties and methods are described below :-

Methods/Property Description
appName returns the name
appCodeName returns the code name
cookieEnabled returns true if cookie is enabled otherwise false
plugins returns the plugins. It is supported in Netscape and Firefox only.
language returns the language. It is supported in Netscape and Firefox only.
userLanguage returns the user language. It is supported in IE only.
systemLanguage returns the system language. It is supported in IE only.
userAgent returns the user agent
appVersion returns the version
mimeTypes[] returns the array of mime type. It is supported in Netscape and Firefox only.






JS training insitute | Best IT Training classes in Gurgaon | Web Designing Training Institute