Get client browser information

.browser()


Description: Detect the user browser and other information about the clients browser.


Example:

<!doctype html>
    <html lang="en">
    <head>
      <meta charset="utf-8">
      <title>browser demo</title>
      <script src="http://code.bitsycode.com/bitsycode-latest.min.js"></script>
    </head>
    <body>
      
      <div class="result"></div>
      
      <script type="text/javascript">
         
         bitsyCode.ready(function(){
            bitsyCode.ready(function(){
               var browser = bitsyCode.browser();
               alert(browser);
               
               bitsyCode(".result").html(browser.name);
            })
         })
         
      </script>
     
    </body>
    </html>

Preview:

  • Usage

    • How to use:

      The .browser() method will return information about the client browser.

    • USAGE:

      bitsyCode.browser();
    • Get specific browser information:

      var browser = bitsyCode.browser();
      alert(browser.name); //alerts browser name
      alert(browser.version); //alerts browser version
  • Options

    • What options are there:

      There are no options for this method.

  • Returns

    • Returns
      Returns:
          object {
              codeName: String, // returns the code name of the browser (All modern browsers returns "Mozilla", for compatibility reasons.)
              name: String, // returns the name of the browser.
              version: String, //returns the version information of the browser.
              agent: String, // returns the value of the user-agent header sent by the browser to the server.
              platform: String, // returns for which platform the browser is compiled.
              engine: String, // 	returns the engine name of the browser.
              cookies: Boolean, // determines whether cookies are enabled in the browser.
              language: String, // returns the language of the browser
              javaEnable: Boolean // specifies whether or not the browser has Java enabled
              online: Boolean // determines whether the browser is online
          }
Share