2

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,

Peter Kellner
  • 14,748
  • 25
  • 102
  • 188
  • 3
    Out of curiosity, why would you care about that? – Sergio Tulentsev Dec 24 '11 at 00:35
  • 2
    It would be better to use some form of feature detection to discern whatever difference you are looking for. They you wouldn't have to change your code again when there's an iPad3 and iPad4 and so on... Tell us what problem you're really trying to solve and we can help. – jfriend00 Dec 24 '11 at 01:19

3 Answers3

1

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.

Martin-Brennan
  • 917
  • 7
  • 19
Siva
  • 26
  • 1
1

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
cnkt
  • 2,943
  • 5
  • 30
  • 43
1

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
Virendra
  • 2,560
  • 3
  • 23
  • 37
  • Also, from Apple's site, how you can check iPad's User Agent. http://developer.apple.com/library/safari/#technotes/tn2010/tn2262/_index.html – Virendra Dec 24 '11 at 03:30