Device and Feature Detection

Eric Sowell · Apress eBooks · 2013

In an ideal world we could always return the same HTML, CSS and JavaScript for any given page on our website. In the real world differences in capabilities and browser bugs will often necessitate some sort of client-side asset split. For example, JavaScript for doing photo uploads in the browser makes sense for recent iPhones and Android devices because they support the feature but not for older devices. Or perhaps you wish to use a feature of CSS for some devices and not others because of buggy support. In the last chapter we discussed how to do this. We saw that we could use custom View Engines, Display Modes, and HtmlHelpers to generate HTML for specific devices. And if you control the HTML, you control what CSS and JavaScript gets included. In this chapter you will learn how to do this intelligently , including learning techniques related to device and feature detection and discussions on where each one is useful. These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Read the paper · More papers on PaperTik