Best way to detect mobile device in jQuery

346195 pts.
Tags:
jquery
Mobile
Mobile devices
Would anybody know of the best way to detect whether a user is actually using mobile device in jQuery? Is there something like the CSS media attribute? I know there's the jQuery "$.browser" function but I'm looking for a different way. Thanks!

Answer Wiki

Thanks. We'll let you know when a new response is added.

Only way to really test this is checking the user agent.  But its not a sure-fire solution.  You could also check the resolution but that’s easily faked as well.

Take a look at this similar question.  The site mentioned in the answer offers a jQuery script that you might want to take a look at:

How can we detect a mobile device using JavaScript?

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following