Handling Errors


We'll turn now to the third topic in this chapter: handling errors. This topic isn't so much about syntax errors, which cause your script not to run in the first place, but handling errors that happen at runtime, such as when a numeric value is greater than can fit into a JavaScript variable.

You can handle runtime errors two ways in JavaScript:You can use the onerror event handler; and, more recently, you can use try catch statements. I'll take a look at both techniques here.



Inside Javascript
Inside JavaScript
ISBN: 0735712859
EAN: 2147483647
Year: 2005
Pages: 492
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net