groups

name language licence
JS : Date du client en javascript Other Other
HTML5 : Structure par defaut + commentaires Other Other
JOOMLA : Création de templates personnalisés Other Other
JQUERY : Aide sur live() (anglais) Other Other
CSS : ordre des paramètres pour les supers propriètés margin et padding CSS Other
PHP/JAVASCRIPT : detecter un iphone ou ipod touch Other Other
PHP : recuperer l'adresse IP du visiteur Other Other
JQUERY : Aide sur live() (anglais) JS-JQuery Other

< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 >



language: Other
licence: Other

PHP/JAVASCRIPT : detecter un iphone ou ipod touch

options: view full snippetsend to code collector
Détecter un iPhone/iTouch
Les User Agents renvoyés par l'iPhone et l'iTouch ressemblent à quelque chose comme ça. Quelques détails peuvent changer selon les versions :
 
User Agent iPhone
Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) 
AppleWebKit/420+ (KHTML, like Gecko) 
Version/3.0 Mobile/1A543a Safari/419.3

User Agent iPod iTouch
Mozilla/5.0 (iPod; U; CPU like Mac OS X; en) 
AppleWebKit/420.1 (KHTML, like Gecko) 
Version/3.0 Mobile/3A100a Safari/419.3

Détection en Javascript
if(navigator.userAgent.match(/iPhone/i) 
	
(Continues...)