Hello there,
is it possible to disable displaying a JavaScript Error in JavaScript?
| SitePoint Sponsor |
Hello there,
is it possible to disable displaying a JavaScript Error in JavaScript?
Words are weapons of Mass Destruction.



Code:window.onerror = function() { //alert("error"); return true; }
- Pip
---------------------------------------------------------------------------------
Nothing takes the taste out of peanut butter quite like unrequited love.




seems not working??



Tested in both IE7 and FF... works on my side... problem might be that your script falls over before it reaches the window.onerror event handler.... my advice is to add this script right at the top of your documents, in a seperate script block.
- Pip
---------------------------------------------------------------------------------
Nothing takes the taste out of peanut butter quite like unrequited love.



sorry... wrong post
- Pip
---------------------------------------------------------------------------------
Nothing takes the taste out of peanut butter quite like unrequited love.



Did you manage to get this working?
- Pip
---------------------------------------------------------------------------------
Nothing takes the taste out of peanut butter quite like unrequited love.

You can use try and catch instead.Code:try { // Your code here. } catch (e) {};



Yea... that's another idea... probably the better idea too... didn't think of that
- Pip
---------------------------------------------------------------------------------
Nothing takes the taste out of peanut butter quite like unrequited love.



then again... that would have to be applied around specific code... you wouldn't have a global error event handler.
- Pip
---------------------------------------------------------------------------------
Nothing takes the taste out of peanut butter quite like unrequited love.
Bookmarks