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
Post a Comment