February 2008
Beginner
416 pages
9h 53m
English
After reading this chapter, you'll be able to
Understand error handling using JavaScript methods.
Handle errors using try/catch statements.
Use try/catch/finally statements.
Handle the onerror event for window and image objects.
This chapter looks at two primary, built-in ways of handling error conditions in JavaScript. The try/catch statement pair is available in JavaScript. Many languages, such as Microsoft Visual Basic .NET, include this pair of keywords that help the programmer handle error conditions within their code.
Along with try/catch, JavaScript offers the onerror event, which gives the programmer another tool to perform an action when encountering an error.
Read now
Unlock full access