Writing "Hello World" unobtrusively

An important facet of responsive design is interaction. As we know that mobile devices and desktops have very different user interfaces, we cannot expect that our JavaScript interaction scripts will work across all devices. An illustrative example is the .mouseover() or mouse hover event listener. The mouse is not attached to a touch screen device, so any misdirected attempt at the .mouseover() event would likely function as a .click() event. The solution to this is to fully remove your interaction script from your templates.

Getting ready

This method is referred to as "Unobtrusive JavaScript". Here, instead of embedding scriptlets like onclick() in your HTML template, you can create an external JavaScript that ...

Get HTML5 and CSS3: Building Responsive Websites now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.