O'Reilly logo

Simply JavaScript by Cameron Adams, Kevin Yank

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 4Events

When we started out in Chapter 2, every script that we looked at would be loaded by the browser and executed right away. Since then, we’ve learned how to wait until the HTML document has finished loading before unleashing the awesome power of JavaScript. In every case, however, the script will work its magic (for instance, making the rows of your tables stripy), then fizzle out, leaving behind an enhanced—but still very static—page.

You don’t need to suffer with scripts that peak too quickly! With the simple techniques we’ll explore in this chapter, you’ll learn to take control, write scripts that last longer, and become a superstar … well, in your favorite JavaScript chat room, anyway.

Don’t get me wrong—scripts that enhance ...

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