How can we detect a mobile device using JavaScript?

1149560 pts.
Tags:
JavaScript
Mobile
Mobile devices
My friend and I have been asked by our company to create a HTML page / JavaScript to simulate detection of mobile devices (iPhone/Android/etc.) using a JavaScript code. This would take the mobile user to a different screen, which would ask for their email address. Is this possible? If so, what's the process?
1

Answer Wiki

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

I’m not sure there is reliable way to do it, but you might want to take a look at the scripts provided by detectmobilebrowsers.com.  They seem to be using the user agent and vendor properties, but since new mobile devices come out very frequently, scripts like those would need to be constantly revised.

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.

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.

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

Following

Share this item with your network: