Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Detect Mobile / Computer by Javascript

$(document).ready(function(){
    var ua = navigator.userAgent;

    if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|mobile|CriOS/i.test(ua))
       $('a.mobile-other').show();

    else if(/Chrome/i.test(ua))
       $('a.chrome').show();

    else
       $('a.desktop-other').show();
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Detect #Mobile #Computer #Javascript
ADD COMMENT
Topic
Name
9+3 =