Disable Javascript Errors
Posted by Andy Langton on Wednesday, 21 February 2007
This simple script will prevent javascript errors from being displayed in your visitor's browser
<script type="text/javascript">
function noError(){
return true;
}
window.onerror = noError;
</script>
The functionality is very simple: create a function that always returns true, and then whenever an error occurs, call this function (returning true and suppressing the error).
Shamefully, this script is only tested in IE.
Category:
Comments
Lu
Sun, 03/10/2013 - 20:58
IE please go away! Until then
IE please go away! Until then thanks to people like you.
Richard
Sun, 03/10/2013 - 20:58
Amazing - this has been
Amazing - this has been bugging me for weeks 'cos the error icon looks so unprofessional even if everything else is fixed.
Jocuri
Sun, 03/10/2013 - 20:58
Thanks a lot..
Thanks a lot..
This is a great solution for display errors!
Add new comment