|
||||||||||||
Error Handling DemoQuestion: Can I change the JavaScript error handler without reloading the page?
Answer:
Yes. To change the JavaScript error handler, just set
Here's a demo that lets you test three different error handlers:
Below is the source code of the error handling functions used in this demo: function defaultHandler() {return false} function silentHandler() {return true} function customHandler(desc,page,line,chr) { alert( 'JavaScript error occurred! \n' +'The error was handled by ' +'a customized error handler.\n' +'\nError description: \t'+desc +'\nPage address: \t'+page +'\nLine number: \t'+line ) return true }
JavaScripter.net.
Copyright
© 1999-2006, Alexei Kourbatov
|