MXL Magazine Online
HOMELATEST ISSUEARTICLESBINARY BINGEJAVA JNUKYGUI LABLINKSSHOPABOUT CONTACT  
Home > Issue 007 > Java Junky > Removing Errors

Removing Errors

What is the most annoying thing you cant think of? Well ok, JavaScript error aren't that annoying but nobody likes them. What we need is a simple script that stops all the JavaScript erros from appearing. This is a pretty simple script which is short so lets dive straight into the code:

<script>

function stoperror(){
return true
}
window.onerror=stoperror
</script>

Just stick the script into the <head> tag. Although the above alert method is invalid (no closing quotations), no errors will be generated. This script will suppress all potential errors in a page, so be sure to turn it off while test running a script.