title: How to trace or log Javascript errors on Javascript files in a page?
body: <p>I am developing one plug-in in jQuery/Javascript. In that I need to log Javascript errors of all Javascript files in a page. I tried this code to log and pass this to databae using Ajax</p>
  <pre><code>error_log=new Array();
   window.onerror=function(msg, url, line)
  { 
  
  error_log.push(&quot;Message:&quot; + msg + &quot;-------URL:&quot; + url + &quot;-------Line:&quot; + line);
    
  }
  </code></pre>
  <p>Its working, but I need some more options and suggestions about logging js Errors.</p>
  <p>I need the array containing Javascript errors in a page.</p>
  <p>Please help me to improve the capturing errors in a page.</p>
  <p>P.S: I don't need any js tracking websites like <strong>jslogger, airbrake, errorception, exceptionhub</strong></p>