Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Javascript
Suppressing err msg globally
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="VK, post: 4969435"] window.onerror = function(){return true;}; or (equivalent): <body onerror="return true;"> That prevents from showing any error messages, but on the first runtime error occurred the script execution will stop globally, as you already properly noticed. The only workaround exists for Gecko browsers implementing multi-threating in Javascript (it was necessary as the whole top and middle layer of Gecko are written in Javascript). For Gecko the execution and clean up happen only for the current execution context, so on unhandled runtime error one may escape to a parallel context over timeout: window.onerror = function(){ window.setTimeout('resumeNext()',1); return true; } That is a very risky way to handle anything and I would strongly oppose to such coding moreover it's Gecko-only. Still I had to mention. Javascript doesn't have On Error Resume Next and similar constructs. This way the only mean to prevent errors bubbling yet keep the script executing is to try to wrap it in whole into try-catch block. Uhmm... Do you really want to try that? :-) So no, there is not anything close to what you are asking about. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Javascript
Suppressing err msg globally
Top