Reputation: 453
Is there a way of detecting the first generation iPad exclusively using either javascript or PHP?
I need to use some fallback javascript on the first gen iPads, as the newer iPads are fine.
Upvotes: 1
Views: 187
Reputation: 1027
In PHP you can detect iPad with the following.
if (strstr($_SERVER['HTTP_USER_AGENT'], 'iPad')) {
echo "Its an iPad";
}
Upvotes: 2
Reputation: 45490
<script>
if (/Apple-iPad/i.test(navigator.userAgent)) {
//iPad first generation detected!
}
</script>
Upvotes: 0