title: javascript: how to display script errors in a popup alert?
body: <p>I want to display script errors in a popup alert instead of showing them in the browser console.</p>
  
  <pre><code>window.onerror = function() {
    var message = /* get error messages and put them here */;
    alert(message);
    return true;
  };
  </code></pre>