Book Image

Mastering jQuery Mobile

Book Image

Mastering jQuery Mobile

Overview of this book

Table of Contents (17 chapters)
Mastering jQuery Mobile
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Device detection with WURFL


In the previous section, we looked at the role Modernizr plays in mobile development using feature detection. Now we look at another piece of the puzzle: device detection. Why do we need device detection you say? While we can see what features the browser supports, it is also nice to see what actual device the user is using.

Let's look at an example on why we would want this. You have been working on a mobile website and, during development, you notice that it behaves differently on a Galaxy Tab than it does on an iPad. You bang your head on the wall trying to get one CSS file to serve both but nothing works, and you think to yourself how great it would be if you could have the Galaxy Tab use one CSS file and the iPad use another. Well device detection allows you to do just that.

For this book, we will be using the cloud version of WURFL from ScientiaMobile. Why's that? Well, over the years, ScientiaMobile has changed so that the downloaded version of the WURFL...