Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
System Events1:09 with Andrew Chalkley
System events are cool
There are two types of events that can occur.
A user event or a system event.
An example of a user event is a mouse click.
When a mouse click happens on the button, the callback is triggered and
then an alert is shown.
An example of a system event is the setTimeout function.
A call back gets executed after a given time.
The developer may define the time when the call back gets executed, but
the system is what triggers it.
Another example of a system event is the ready state change of an Ajax request.
[SOUND] The ready state change handler gets triggered by the system when
it goes through different stages of the request.
For example, when it sends the request, when it loads data in, and
when it's finished.
Node.js has a number of system events like reading data from a URL or
file, when an action is completed, and various error handling events.
We'll cover these throughout this course.
You need to sign up for Treehouse in order to download course files.Sign up