javascriptmobile-website

Getting (mobile) device name from javascript


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".


Solution

  • 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.