title: Does Javascript fire an event for unhandled/uncaught exceptions?
body: <p>I'm looking to log unhandled javascript exceptions. Is there an event that fires when an exception isn't caught? I'm looking to catch the exceptions before they cause javascript errors in the browser, but I'd rather not run my entire application inside of a try/catch. Any help would be appreciated. Thanks!</p>
  
  <p>Update: 
  tvanfosson pointed out onerror as a possibility. It is not part of a spec and is only available in IE or Gecko based browsers.</p>
  
  <p>For more information - <a href="http://books.google.com/books?id=tKszhx-XkzYC&amp;pg=PA386&amp;lpg=PA386&amp;dq=safari+onerror+javascript&amp;source=web&amp;ots=gQaGbpUnjG&amp;sig=iBCtOQs0aH_EAzSbWlGa9v5flyo#PPA387,M1" rel="noreferrer">http://books.google.com/books?id=tKszhx-XkzYC&amp;pg=PA386&amp;lpg=PA386&amp;dq=safari+onerror+javascript&amp;source=web&amp;ots=gQaGbpUnjG&amp;sig=iBCtOQs0aH_EAzSbWlGa9v5flyo#PPA387,M1</a></p>
  
  <p>OnError Support Table - <a href="http://www.quirksmode.org/dom/events/error.html" rel="noreferrer">http://www.quirksmode.org/dom/events/error.html</a></p>
  
  <p>Mozilla's documentation - <a href="https://developer.mozilla.org/en/DOM/window.onerror" rel="noreferrer">https://developer.mozilla.org/en/DOM/window.onerror</a></p>
  
  <p>WebKit Bug Report - <a href="https://bugs.webkit.org/show_bug.cgi?id=8519" rel="noreferrer">https://bugs.webkit.org/show_bug.cgi?id=8519</a></p>