简体   繁体   中英

JavaScript - detect mobile vendor natively (no jquery)

Is there anyway to get in javascript the mobile vendor?
LG, Samsung Apple.
Is so, is it possible to get the model?
G2, Galaxy S3, Iphone5

Thanks

Try and fetch the User Agent using javascript and see if you can find what you are looking for

navigator.userAgent

This will give you the user agent. Once you get the user agent, you can check for some pattern in the user agent for each of the manufacturers device. Generally the UserAgents contains the manufacturer name in them. Also they contain the model number in them. For example, iPhone have the user agent prefix as Apple-iPhone4C1/

You can google and get the list of the user agents for major manufacturers.

For Apple: http://www.enterpriseios.com/wiki/Complete_List_of_iOS_User_Agent_Strings

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM