Javascript Notifier

Airbrake has the ability to catch javascript errors that occur in browsers viewing HTML pages from your web application.

Enable from rails

If you are using rails, you can enable the JS notifier with this line in your page layout, within the 'head' section

<%= airbrake_javascript_notifier %>

This will insert something similar to the following javascript into your page:

<script type="text/javascript"> 
var notifierJsScheme = (("https:" == document.location.protocol) ? "https://" : "http://");
document.write(unescape("%3Cscript src='" + notifierJsScheme + "' type='text/javascript'%3E%3C/script%3E"));

<script type="text/javascript">
      url: "",
      component: "pages",
      action: "show"

The XXXXXXXXXXXX value will be your actual API key, and the other values will be replaced with values appropriate to the page.

Manually inserting the JS

If you are using another framework, you can manually assemble this javascript to enable JS error tracking. It's important to insert it right after the opening "head" tag of the HTML (ie, within the head section), so that any errors that occur on the page are caught by the HT JS notifier.