Getting (mobile) device name from javascript

julius_am picture julius_am · Aug 13, 2012 · Viewed 37.9k times · Source

Is there a way to get the name of a mobile device (e.g. "John's iPhone" ) using javascript?


Maybe I wasn't very clear... what I meant is not whether it's an iPhone, iPad etc. but the "device name" - for example it can be "John's iPhone".

Answer

Kevin picture Kevin · Aug 22, 2012

You can't do this through javascript for a web app running in a native browser - javascript generally doesn't have access to this personal identifying data.

One possible way is to use a framework like PhoneGap which may have an API to access the device name. But then, you can only deploy your web site via an app store, so this could be very limiting based on your use case.