javaScript window navigator object

the navigator object contains information about the client browser.

navigator object properties

propertydescription
appnameretrieves the name of the client.
appCodeNamereturns the code name of the browser
appVersionreturns the platform and version of the application
appMinorVersionreturns the application's minor version value.
browserLanguagereturns the current operating system language
cookieEnabledreturns a boolean indicating whether cookies are enabled or not
onLinereturns a value indicating whether the system is online
platformreturns the name of the user's operating system.
userAgentreturns a string equivalent to the http user-agent request header
   document.write('<br/>'+"appName ="+navigator.appname);
           
   document.write('<br/>'+"appCodeName  ="+navigator.appCodeName);
                      
   document.write('<br/>'+"appVersion  ="+navigator.appVersion);
           
   document.write('<br/>'+"cookieEnabled  ="+navigator.cookieEnabled);
           
   document.write('<br/>'+"onLine  ="+navigator.onLine);
           
   document.write('<br/>'+"platform  ="+navigator.platform);
           
   document.write('<br/>'+"userAgent  ="+navigator.userAgent);

JavaScript navigator object methods

the navigator.javaEnabled() method returns a boolean value that specifies whether the current browser is java-script enabled or not.

syntax:

           window.navigator.javaEnabled()
function   java_enabled(){
   
   
             if(navigator.javaenabled() == true ){ 
                                  
                // this code executed when java_script is enabled
                                                 
                                window.alert("hello java script is enabled");
                                                 
                                                 }
                                                 
             if(navigator.javaenabled == false ){
                                  
                                      
                // the code is executed if java-script is not enabled
                                          
                                window.alert("the java is not enabled");
                                                 
                            }                      
                      }

javascript navigator object provides properties that indicate the type of browser and other useful information about the user accessing the page.