HTML5: Detecting if you’re on mobile or pc with javascript? [duplicate]
I was looking into this a few years back. In short, you can’t do this with 100% reliability. There seem to be 2 approaches commonly used to provide a ‘best-guess’: 1. User Agent Detection This is where you check what the client is claiming to be. e.g. if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { // is mobile.. … Read more