↑
Main Page
Function Options
You can also determine which functions are profiled. To set an entire file so that it won’t be profiled,
right-click on the file in the Loaded Scripts view and select File Options
?
Don’t Profile Contained
Functions. If you want to disable profiling for a single function, right-click on the function in the Loaded
Scripts view and select Function Options
?
Don’t Profile.
Summary
This chapter introduced the many aspects of errors and error handling in JavaScript. The
onerror
event
handler was covered, including the creation of your own error-message windows. You also learned how
to use the
try...catch
statement to trap errors in progress. An in-depth discussion of the
Error
object
followed, introducing you to how you can throw your own JavaScript errors.
Next, several debugging techniques were discussed, ranging from using alerts and Java console messages
to throwing your own errors. You also learned how to create your own
assert()
function to make throw-
ing your own errors easier.
Finally, you were introduced to the JavaScript debuggers for Internet Explorer and Mozilla. You learned
how to download, install, and run each debugger in its browser, as well as how to use the debugger to
set breakpoints and step through code.
443
Error Handling
17_579088 ch14.qxd 3/28/05 11:41 AM Page 443
Free JavaScript Editor
Ajax Editor
©
→