Disable Javascript Errors

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

IE please go away! Until then

IE please go away! Until then thanks to people like you.

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.

Thanks a lot..

Thanks a lot..
This is a great solution for display errors!

Add new comment