Yes, that's right. You can get rid of error messages if you're concerned that some browser will give a JavaScript error when trying to read your scripts. That way your visitors will not be discouraged - me, for example, if I encounter a page with a JS error, I usually just leave because I can't be bothered. Or I select "No, don't run any more scripts" and if the person who made the page relies on JavaScript for presentation, I will leave their site thinking "Man, what a tool!" :) Well, behold the answer to that problem:
<SCRIPT LANGUAGE="JavaScript" TYPE="">
<!--
function stoperror()
{
return true
}
window.onerror=stoperror()
//-->
</SCRIPT>
If you don't believe me that this works, try looking at the source code for this page [right-click and select View Source]. You'll see the stop-error function, as well as some other JavaScript code - which is complete gibberish, but you didn't get an error message, did you? :)
There is a catch, however. If your erroneous JavaScript code contains any one of the reserved words [listed in the Cautions section], it will still give an error. :(