javascript pocket guide [burdette]

Page 141

114

The JavaScript Pocket Guide

layer above that should just progressively enhance the content below it, making the experience more attractive, more efficient, and more engaging. If a layer isn’t available to a user, the core content of the page should still be just as accessible. One of your most important “users” isn’t a person at all. Search engine robots are like blind, deaf, keyboard-reliant users who browse the Web with images and JavaScript turned off. Search engine optimization (SEO) and progressive enhancement often go hand in hand. Progressive enhancement and accessibility are incredibly important topics that unfortunately are a bit beyond the scope of this book. Still, I’ll show how I include progressive enhancement techniques in my examples starting in Chapter 14 of the book.

Handling Non-JavaScript Situations If a user comes to your page without JavaScript, you can use two different techniques to make sure your content is still accessible. Keep in mind that your HTML and CSS foundation must be well organized for these techniques to be of any use.

The <noscript> Tag Browsers only show the content inside the <noscript> tags when JavaScript is unavailable. I don’t find this to be terribly useful; it’s often used to display a message notifying the user of the missing JavaScript behaviors. <noscript> <p>This page requires JavaScript.</p> </noscript>


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.