Identifying the devices

Probably you're reading this book because you're interested in developing applications for the iPhone. However, other devices are running the same operating systems used by this smartphone. Actually, we have two more: iPad and iPod Touch. The first one is the most modern gadget designed by Apple. The other one is an advanced multimedia player with functionalities and features close to smartphones and PDA's. Because the devices have their differences, it could be useful to detect what device is using our application to do specific actions for each of them. This recipe shows you how to do that.

Getting ready

For this recipe, we don't need any framework. We're going to use only a bit of JavaScript code in a plain HTML file. ...

Get iPhone JavaScript Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.