O'Reilly logo

HTML, CSS and JavaScript All in One, Sams Teach Yourself: Covering HTML5, CSS3, and jQuery, Second Edition by Julie C. Meloni

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 21. JavaScript Best Practices

What You’ll Learn in This Chapter:

Best practices for creating unobtrusive scripts

Separating content, presentation, and behavior

Following web standards to create cross-browser scripts

Reading and displaying browser information

Using feature sensing to avoid errors

Supporting non-JavaScript browsers

In this chapter, you’ll learn some guidelines for creating scripts and pages that are easy to maintain, easy to use, and follow web standards. This is known as unobtrusive scripting: Scripts add features without getting in the way of the user, the developer maintaining the code, or the designer building the layout of the site. You’ll also learn how to make sure your scripts will work in multiple browsers, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required