What is the best way to detect a mobile device?
Editor’s note: user agent detection is not a recommended technique for modern web apps. See the comments below this answer for confirmation of this fact. It is suggested to use one of the other answers using feature detection and/or media queries. Instead of using jQuery you can use simple JavaScript to detect it: Or you … Read more