×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Roman Ignatov
Added: Nov 30, 2016 10:56 AM
Views: 4
Tags: no tags
  1. window.onerror = function(msg, url, line) {
  2.   _gaq.push(['_trackEvent', 'Error Log', msg, url + '_' + line]);
  3.  
  4.   var xhr = new XMLHttpRequest();
  5.   xhr.open('POST', '/jserror', true);
  6.   xhr.send('Line ' + num + ': (' + url + ') - ' + msg);
  7.  
  8.   return false;
  9. };