1

I'm tying to wrote script to detect mobile browsers that 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, but is targetting IE mobile too.

Is better JS way to target mobile browsers or all browsers that arent supporting css 100vh and 100vw value?

1 Answer 1

1

It would be better to use feature detection rather than browser/device sniffing. You could use something like Modernizr to do this or see how they are doing it here.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.