How can I discover the model of a smartphone or tablet with Javascript? -


i website show mobile visitors device make , model recognized. aware of javascript scripts tell me whether device mobile phone or tablet, need here actual make , model (htc one, blackberry storm, , on). aware of tools such wurfl, require me perform sort of php development seems overkill kind of feature.

am asking much?

luca passani, wurfl inventor here. company launched service pretty solves problem mentioned free of charge. advise check out http://wurfl.io/

in nutshell, if import tiny js file:

<script type='text/javascript' src="//wurfl.io/wurfl.js"></script> 

you left json object looks like:

{  "complete_device_name":"google nexus 7",  "is_mobile":true,  "form_factor":"tablet" } 

(that's assuming using nexus 7, of course) , able things like:

if(wurfl.form_factor == "tablet"){     //dostuff(); } 

or

modelname = wurfl.complete_device_name 

this looking for. please observe service correctly detects specific iphone models, rather hard nut crack.

i see commented maintaining list of devices big task. correct, if wasn't service doing you, don't need keep updated.

thanks


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -