Chapter 4
Reacting to Events with JavaScript and jQuery
IN THIS CHAPTER
Exploring web page events
Using events with JavaScript
Using jQuery and events
In the previous chapters in this book, you've seen how to incorporate both JavaScript and jQuery into your HTML5 code to help create a dynamic web application. The trick to using JavaScript and jQuery, though, is knowing when to use them. How are you supposed to know when your site visitor is hovering the mouse pointer over a product in your catalog to pop up more information? Fortunately, your web page is talking to you, telling you what your site visitors are doing at all times. All you need to do is listen to your web page and direct your JavaScript or jQuery code accordingly. That's exactly what this chapter shows you how to do.
What Are Events?
The world is full of events. There are birthday events, holiday events, school events, and all types of events competing for your time. Your world is loaded with events, and it's your job to determine which events to participate in (such as your birthday), and which ones to ignore (do we really need a special day to honor talking like a pirate?).
The same is true with your web application. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access