|Written by Ian Elliot|
|Wednesday, 20 March 2013|
Why be restricted to how HTML5 and CSS can perform responsive layout? Why not intercept the entire DOM before it is rendered or resources are downloaded, process it as you like and then and only then render it? This is what Capturing is all about.
In short, Capturing gives you access to the page's DOM before the HTML has been rendered or any resources loaded.
For example, if you have an image tag on the page then Capturing will represent that image tag in the DOM it passes to your code. However, any files specified in the src attribute will not be loaded. Your code can modify the src attributes to refer to files with the appropriate resolution for the client and then render the DOM to the page.
This takes us well beyond the sort of responsive design you can achieve using the current HTML5/CSS 3 standards. In fact it takes us into another level of using HTML as a markup language - one that can be custom-processed before the standard rendering engine gets to work with it.
The examples on the Mobify.js site should give you some ideas, but in many ways its examples are conservative. You could take the principle much further by extending HTML5 in any way you cared to - inventing your own domain specific markup language and then processing it to standard HTML before rendering it. With this technology the web page is set free from HTML.
To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, Facebook, Google+ or Linkedin, or sign up for our weekly newsletter.
or email your comment to: email@example.com
|Last Updated ( Wednesday, 20 March 2013 )|