Disable Javascript Errors

0

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>

Or jQuery:


$(window).error(function(){
return true;
});

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.

Labels: ,
Loading related posts...

0 comments:

Post a Comment

2010 WEBSITE20. All rights reserved.