enltr xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/terms/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:og="http://ogp.me/ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:sioc="http://rdfs.org/sioc/ns#" xmlns:sioct="http://rdfs.org/sioc/types#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#"http://www.w3.org/1999/xhtml/vocab/////////////////Detect if a smartphone is being used | BitsyCodehttps://www.bitsycode.com/methods/dom/smartcheckDetect if a smartphone is being used | BitsyCode Detect if a smartphone is being used | BitsyCode html not-front not-logged-in no-sidebars page-node page-node- page-node-31 node-type-page

Detect if a smartphone is being used

container

.smartCheck()


Description: Detect if the user is using a smartphone to browse your website using JavaScript mobile device detection.


Example:

    <!doctype html>
    <html lang="en">
    <head>
      <meta charset="utf-8">
      <title>smartCheck demo</title>
      <script src="http://code.bitsycode.com/bitsycode-latest.min.js"></script>
    </head>
    <body>
        
        <div class="result"></div>
        
        <script>
            
            bitsyCode.ready(function(){
                var isSmart = bitsyCode.smartCheck();
                
                if (isSmart.detected) {
                    bitsyCode(".result").html("<b>Detected:</b> Smartphone detected.<br /><b>Browser:</b> " + isSmart.browser);
                } else {
                    bitsyCode(".result").html("Smartphone NOT detected.");
                }
            })
            
        </script>
     
    </body>
    </html>

Preview:

Share

Developed and built with passion and commitment.
Maintained by the bitsycode team.