O'Reilly logo

iPhone JavaScript Cookbook by Arturo Fernandez Montoro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required