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

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -