PDA

View Full Version : Error messages


LoveLeather
01-07-2009, 05:53 PM
Does anyone know what this code would be used for?

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

ranjan
01-11-2009, 06:30 AM
window.onerror --> when a javascript error is triggered
stoperror --> perform the function stoperror()
function stoperror(){return true} --> function purges javascript errors

This means users will not see any javascript errors.

Usually when javascript errors occur the execution of the script stops, be aware of that if you use the above