January 2013
Beginner
204 pages
4h 48m
English
CHAPTER 5
![]()
An Introduction to Events
When you write JavaScript in the browser, you’re writing event-driven code. Most of your code will be executed when something happens, such as having content slide in when a user clicks a link. Even though you might not have realized it, you’ve already written some event-based code:
$(function() {});
You’ve been writing code that runs when the document is ready, as I’ve explained. This is an event that you’re attaching code to. It is also known as binding. You have bound some code to run on a certain event. In this chapter, you will look at the type of events, and at the end of the chapter, use your new knowledge ...
Read now
Unlock full access