I am wondering how to best handle javascript errors. My application is pretty javascript intensive and although I’m doing everything possible to test my code, I know that bugs will be inevitable.
Is there a way catch errors and reload the page when they occur? I know about try/catch but rather then adding a bunch of these, I was wondering if there’s a way to add something in document.ready that execute a page reload on error.
Thanks for your suggestions.
You’re looking for the
window.onerrorevent.Beware that if an error occurs on page load, you may end up recursing.