Skip to Content
Programming the Mobile Web, 2nd Edition
book

Programming the Mobile Web, 2nd Edition

by Maximiliano Firtman
March 2013
Intermediate to advanced
774 pages
20h 36m
English
O'Reilly Media, Inc.
Content preview from Programming the Mobile Web, 2nd Edition

Chapter 9. Feature and Device Detection

Before moving on with more HTML5, CSS, and JavaScript code that we can use on mobile devices, we need to pause and talk about feature and device detection. As we saw in the last chapter, not every browser supports exactly the same features, and even different versions of the same browser may have differences in terms of what we can use.

This book was likely finished a few months (or maybe even years) before you picked it up. I can assure you that what some browsers support today may differ from what they supported at the time I was writing it.

This is not just a book authoring issue. It’s also a development issue, because we can’t constantly update every website and web app we create to suit every new browser version or platform on the market.

Therefore, we need a way to design and develop our code that makes it as future-proof as possible. To that end, we are going to look at some techniques that will be useful for feature detection, device detection, and fallback mechanisms.

In combination with all these techniques, we can use the progressive enhancement technique (covered in Chapter 5) and some graceful degradation hacks to ensure that our code works as well as possible on as many platforms as possible.

Possible Problems

To find the right solutions, first we need to recognize all the possible problems we may need to deal with. We can summarize the possible problems with regard to features as follows:

  • An HTML feature we want to use is not available, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Mobile Applications: Architecture, Design, and Development

Mobile Applications: Architecture, Design, and Development

Valentino Lee, Heather Schneider, Robbie Schell
High Performance Mobile Web

High Performance Mobile Web

Maximiliano Firtman

Publisher Resources

ISBN: 9781449335595Errata Page