TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

JavaScript navigator object

JavaScript navigator object, example, properties of javascript navigator, object, appName, appVersion, appCodeName, cookieEnabled, plugins, systemLanguage, platform, methods of javascript navigator object, example of navigator object etc.

<< Back to JAVASCRIPT

JavaScript Navigator Object

The 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 object

There are many properties of navigator object that returns information of the browser.

No.PropertyDescription
1appNamereturns the name
2appVersionreturns the version
3appCodeNamereturns the code name
4cookieEnabledreturns true if cookie is enabled otherwise false
5userAgentreturns the user agent
6languagereturns the language. It is supported in Netscape and Firefox only.
7userLanguagereturns the user language. It is supported in IE only.
8pluginsreturns the plugins. It is supported in Netscape and Firefox only.
9systemLanguagereturns the system language. It is supported in IE only.
10mimeTypes[]returns the array of mime type. It is supported in Netscape and Firefox only.
11platformreturns the platform e.g. Win32.
12onlinereturns true if browser is online otherwise false.

Methods of JavaScript navigator object

The methods of navigator object are given below.

No.MethodDescription
1javaEnabled()checks if java is enabled.
2taintEnabled()checks if taint is enabled. It is deprecated since JavaScript 1.2.

Example of navigator object

Let’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>
Test it Now
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




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf