Detecting a specific iPhone / iPod touch model in Javascript

I am developing a website for Apple i * devices that uses HTML5 web caricature features such as transitions, but I want to disable some of the fancy things for older / slower iPhone models like iPhone <3GS and iPod touch <3- generation because transitions are too slow on these devices.

Is there a way to detect the exact model (and not just the OS / User Agent) in Javascript?

+7
javascript html5 iphone ipod-touch
source share
1 answer

It seems that this works, at least for determining between 2 and 3g and 3gs ... I don’t know how to find out if it is still 4g ...

var percentmobile_t = new Date().getTime(); var percentmobile_s = 0; while(new Date().getTime() - percentmobile_t < 20) { Math.random(); percentmobile_s++; } _is2_or_3g = (percentmobile_s < 1000); 
+3
source share

All Articles