Slide 15
Slide 15 text
Solution
When handling browser events, you have the following methods:
1) stopPropagation() - traps the event and doesn't let it bubble up to the parent
nodes
2) preventDefault() - doesn't let the browser do the default action (for example,
following a link or submitting a form)
There are two separate methods with different purposes and they should be kept
separated, but at the same time, they are often called together. So instead of
duplicating the two method calls all over the application, you can create a facade
method that calls both of them: