Reputation: 15488
the navigator.useragent comes back the same if they are at the same IOS version.
The useragent is the same so that does not work (I have both an Ipad1 and Ipad2 so I know that is the case).
I need to know because the memory available to an Ipad1 is less than an Ipad2 and I need to do less prebuffering on an Ipad1 or I get crashes.
Thanks,
Upvotes: 2
Views: 654
Reputation: 26
The iPad1 has no gyroscope and the iPad2 has, check for deviceOrientation events and see if it returns you any value, if it does then you are in iPad2 else you are in iPad1.
Upvotes: 1
Reputation: 2553
I don't know any way of identifing the version of iPad from the User Agent. Also, I am curious why would you want to differentiate between iPad1 and 2?
You can however, identify the iOS version from it. Here are sample User-Agents for iPad1 and 2.
iPad 1 UA:
Mozilla/5.0 (iPad; U; CPU OS 4_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8F190 Safari/6533.18.5
iPad 2 UA:
Mozilla/5.0 (iPad; CPU OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.0.2 Mobile/9A5248d Safari/6533.18.5
Upvotes: 1
Reputation: 2973
You can use the User Agent string but i don't think it will help because the only info you can get from the user agent is the OS Version and the Browser type & version. like:
Mozilla/5.0 (iPad; CPU OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.0.2 Mobile/9A5248d Safari/6533.18.5
Upvotes: 1