I have a website using lots of jQuery and JavaScript that produces a “Done, but with errors on page” message in the footer of IE. Everything on the site works perfectly, so I don’t want to spend the time troubleshooting the exact error. All I would like to do is suppress the “Done, but with errors on page” message so that clients don’t freak out.
I tried the following at the top of the page with no success:
window.onerror = function() {return true;}
You can’t stop the browser from telling users that there’s errors on the page. That would be a security hole, and you don’t really have the right to. You have no choice but to try to fix it or have users see the message.
Does this mean you should try and fix the error? Well, seeing as you can’t suppress it, and you are correct in thinking that users won’t enjoy the message, and that there are tons of excellent debugging tools available, there’s really no reason not to.
Heed the warnings your tools give you, I’ve heard on the streets that the people who wrote them were pretty smart cookies. 😀