There are two ways of catching errors in a web page:
|
|
The try...catch try block contains the code to be run, and the catch block contains the code to be executed if an error occurs.
Note that try...catch The example tries to display the message try...catch alert is misspelled, a JavaScript error occurs.
|
|
err
.
It will be discussed in the next slide.
The onClick
event executes JavaScript code when a click event occurs; that is, when an object on a form is clicked.
Did you hear what happened when the guy who wrote the song ‘The Hokey Pokey’ died? They couldn’t close his coffin. Every time they put a right foot in, he put his left foot out. — Felipe Esparza |