C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
JavaScript Navigator ObjectThe JavaScript navigator object is used for browser detection. It can be used to get browser information such as appName, appCodeName, userAgent etc. The navigator object is the window property, so it can be accessed by: window.navigator Or, navigator Property of JavaScript navigator objectThere are many properties of navigator object that returns information of the browser.
Methods of JavaScript navigator objectThe methods of navigator object are given below.
Example of navigator objectLet’s see the different usage of history object. <script> document.writeln("<br/>navigator.appCodeName: "+navigator.appCodeName); document.writeln("<br/>navigator.appName: "+navigator.appName); document.writeln("<br/>navigator.appVersion: "+navigator.appVersion); document.writeln("<br/>navigator.cookieEnabled: "+navigator.cookieEnabled); document.writeln("<br/>navigator.language: "+navigator.language); document.writeln("<br/>navigator.userAgent: "+navigator.userAgent); document.writeln("<br/>navigator.platform: "+navigator.platform); document.writeln("<br/>navigator.onLine: "+navigator.onLine); </script> navigator.appCodeName: Mozilla navigator.appName: Netscape navigator.appVersion: 5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36 navigator.cookieEnabled: true navigator.language: en-US navigator.userAgent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36 navigator.platform: Win32 navigator.onLine: true
Next TopicJavaScript Screen Object
|