javascript - Jquery to check Android native browser or Chrome -


i used script , many differnt ways.. still output both samsung native browser & chrome "android chrome"

can pls solve issue?

var nua = navigator.useragent; var is_android = ((nua.indexof('mozilla/5.0') > -1 && nua.indexof('android ') > -1 &&     nua.indexof('applewebkit') > -1) && !(nua.indexof('chrome') > -1));  var chrome_android = (nua.indexof('chrome') > -1);  if(is_android){     $('.nativebrowser').show();     $('.othermobbrowser').hide();     alert("android native") } else if(chrome_android){     $('.nativebrowser').hide();     $('.othermobbrowser').show();     alert("android chrome") } 

var ua = navigator.useragent; var is_native_android = ((ua.indexof('mozilla/5.0') > -1 && ua.indexof('android ') > -1 && ua.indexof('applewebkit') > -1) && (ua.indexof('version') > -1));  if(is_native_android){     $('.nativebrowser').show();     $('.othermobbrowser').hide(); } else {     $('.nativebrowser').hide();     $('.othermobbrowser').show(); } 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -