Code:
function stopErrors() {
return true;
}
window.onerror = stopErrors;
I think this is what you are looking for and exactly what I used it for as well... I had a problem with an element not being there in time so occasionaly would get the yellow triangle in the corner. I learned to ignore it but the users were freaked out. This is supposed to stop it. I don't think it does if you have your browser to give the pop up error though... can't remember.

hope that helps,
Michael