how to detect mobile device by javascript

While I understand and value the concept of feature detection over browser detection, sometimes the need for knowing whether or not we’re dealing with a mobile device arises.  For in-depth device checking, you can rely on a complex library such as The MobileESP Project.  But for simpler applications, the following snippet can be useful.

Syntax

Live example

[Total: 1    Average: 5/5]
admin
Leave a Reply

Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages