Is there anyway to detect between the iPad and iPad2 via Jquery / Javascript? Or even PHP or some other way from a website?
-
2Possible duplicate: http://stackoverflow.com/questions/5677068/what-is-the-ipad2-user-agent-string According to the comment on the accepted answer, there is no way to differentiate. – aorcsik Jun 03 '11 at 17:03
-
Why would you even want to? They're the same in all important aspects. – fzwo Jun 03 '11 at 17:09
-
Ok thanks inti, it's kind of what I had figured. I want to because the hardware on the iPad2 runs the animation on a clients site smoothly whereas it is quite choppy on the original iPad. – oddpixel Jun 03 '11 at 17:15
-
I have noticed significant differences between the iPad and the iPad 2. For example, I have a web page with a select element, and the options are kind of long. On the original iPad, the options are abbreviated to the point where they are unreadable (see http://stackoverflow.com/questions/4554831/html-select-element-is-abbreviated-in-iphone-or-android-browsers). But on the iPad 2, they show up fine. I haven't been able to find a way to determine for sure whether they will show up fine and I don't know if it is even possible without specific browser or device detection. – Elias Zamaria Jun 03 '11 at 17:56
4 Answers
I have an iPad and an iPad2 with the same iOS version and i don't this this is currently possible it's producing the same exact user agent on both devices.
iPad
Mozilla/5.0 (iPad; CPU OS 5_0_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A405 Safari/7534.48.3
iPad2
Mozilla/5.0 (iPad; CPU OS 5_0_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A405 Safari/7534.48.3

- 9,668
- 3
- 56
- 48
The javascript user agent Mobile string (Mobile/9A405) seems to be dependent on the CPU OS version. So, while some places it may differ by iPad generation, it's often because the CPU OS version is different.
EXAMPLE 1 - different CPU OS = different Mobile/string:
iPad 1 - Mozilla/5.0 (iPad; CPU OS 5_0_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A405 Safari/7534.48:3
iPad 2 - Mozilla/5.0 (iPad; CPU OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B176 Safari/7534.48:3
EXAMPLE 2 - same CPU OS = same Mobile/string:
iPad 1 - Mozilla/5.0 (iPad; CPU OS 5_0_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A405 Safari/7534.48.3
iPad 2 - Mozilla/5.0 (iPad; CPU OS 5_0_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A405 Safari/7534.48.3

- 41
- 4
As you can see below the only difference is ipad:Mobile/8F190 ipad2:Mobile/8F191 so it is possible to chop down the user agent and look for the difference.
The iPad user agent string:
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
The iPad2 user agent string:
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/8F191 Safari/6533.18.5
but i very much doubt there is much difference between the versions of safari, perhaps your just looking to notify the user, that one has more money then the other ;p...

- 46,049
- 7
- 62
- 106
-
Thanks Lawrence. I missed that difference in the user agent string... I'll give that a shot! – oddpixel Jun 03 '11 at 17:54
-
My iPad2 user agent string is actually different than the above. "Mobile/8J2"... I wonder when they change this value? Full user agent string: Mozilla/5.0 (iPad; U; CPU OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5 – oddpixel Jun 03 '11 at 19:04
There are differences which are important, like the camera. For instance I would like to detect a user is on an ipad and not even present the camera button, but if a user is on an ipad2 I will show the camera icon and they can use the camera.
All I can do right now is to call the method to take a picture and if I get an error assume it is an ipad.
-
1Welcome to SO! Could you please explain in more details your method to 'call the method to take a picture'? Is it JS? – jv42 Feb 07 '12 at 10:49