

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the importance of Navigator Object in JavaScript?
Navigator object
Navigator Object has a lot of uses in javascript. This object is used to find the location we needed, whether the browser is in online mode or not, whether Java is enabled or not in our system, etc. Let's discuss some of its uses.
Example-1
In the following example, the navigator object is used to find whether the browser is in online mode or not. At the time of running the code, my system is in online mode so true is displayed in the output.
<html> <body> <script> var x = "Is your browser is in online mode? " + navigator.onLine; document.write(x); </script> </body> </html>
Output
Is your browser is in online mode? true
Example-2
In the following example, the navigator object is used to find whether java is enabled in the pc or not. The time I am running my code, Java is not installed in the pc so false is executed in the output.
<html> <body> <script> var x = "Is java Enabled in your pc:" + navigator.javaEnabled(); document.write(x); </script> </body> </html>
Output
Is java Enabled in your pc: false
- Related Questions & Answers
- What is the role of Navigator object in JavaScript?
- What is the importance of Symbol.isConcatSpreadable in JavaScript?
- What is the importance of Math.trunc() method in JavaScript?
- What is the importance of _isEqual() method in JavaScript?
- What is the importance of _without() method in JavaScript?
- What is the importance of _.initial() function in JavaScript?
- What is the importance of _.union() method in JavaScript?
- What is the importance of str.padStart() method in JavaScript?
- What is importance of startsWith() method in JavaScript?
- What is the importance of "enumerable" attribute in defining a property in JavaScript object?
- What is the importance of hygiene?
- What is the importance of Computer?
- What is the importance of '/g' flag in JavaScript?
- What is the importance of '/i' flag in JavaScript?
- What is the importance of Hindu rituals?
Advertisements