Easiest way to determine if user is on mobile device

RailsTweeter picture RailsTweeter · Mar 12, 2013 · Viewed 26.1k times · Source

I'm showing a notification bar on my website, and frankly, it doesn't work well when its on a mobile device. I'd like to show the bar ONLY for desktop users.

What is the easiest way to determine if a user is on desktop or on mobile?

Answer

injetkilo picture injetkilo · Mar 12, 2013

Check this http://detectmobilebrowsers.com/

Work for Javascript, jQuery etc.