javascript - Mobile native browsers detection script -
i'm tying wrote script detect mobile browsers not supports css 100vh value:
var is_android = ((nua.indexof('mozilla/5.0') > -1 && nua.indexof('android ') > -1 && nua.indexof('applewebkit') > -1) && !(nua.indexof('chrome') > -1)); if (is_android) { document.write('<link rel="stylesheet" type="text/css" href="moz5.css">'); } else { document.write('<link rel="stylesheet" type="text/css" href="maxi.css">'); } this code should target android native browser, targetting ie mobile too.
is better js way target mobile browsers or browsers arent supporting css 100vh , 100vw value?
it better use feature detection rather browser/device sniffing. use modernizr or see how doing here.
Comments
Post a Comment