Book Image

RESS Essentials

Book Image

RESS Essentials

Overview of this book

RESS is a new methodology in the world of web design and development. It attempts to solve the problems that accompany the RWD (responsive web design) approach to web design. RESS is still in its infancy, but it is growing at an exponential rate. RESS Essentials shows you how to make server-side applications smarter and more aware of a visitor's environment limitations (device, screen size, and browser). This allows you to create faster and more reliable websites. Through this book, you will build a solid base of knowledge on RESS-related technologies, while the step-by-step tutorials will help you to create your own RESS system. This book is an introduction to RESS alchemy and gives you an incentive to build your own RESS lab. It will give you a broad overview of the multiple techniques used to code responsive websites in responsible ways. Beginning with an overview of RWD, you will learn the steps involved in setting up RWD for client-side development. You will then learn how to scale images using client- and server-side technology. By the end of this book, you will have learned about the implementation of RESS application patterns, browser feature detection, and various RESS architectures. RESS Essentials will also teach you how to use jQuery with some RWD design patterns and how to employ REST API for RWD pages.
Table of Contents (15 chapters)
RESS Essentials
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Picturefill that mimics the <picture> tag behavior with HTML5 and JS


Picturefill is a polyfill (http://en.wikipedia.org/wiki/Polyfill) that mimics a proposed <picture> element using <span> or <div>. You can find it at https://github.com/scottjehl/picturefill/. To test it, we can use our sample site structure. After downloading a package from GitHub, I copied picturefill.js and external/matchmedia.js into our /assets/js/ directory. Then I linked it from RWD_sample_picturefill.html, which is a copy of RWD_sample.html created in the first chapter. To link JavaScript code, just add the following lines of code:

<script src="assets/js/matchmedia.js"></script>
<script src="assets/js/picturefill.js"></script>

The file matchmedia.js contains the matchMedia() polyfill available at https://github.com/paulirish/matchMedia.js/ for testing media queries in JS, and it is necessary to support the media attributes across browsers.

Now, I have to manually create...