(function() { window.onerror = function(message, url, line, column) { if (typeof url === "undefined" || url === null || url === "") { return; } var data = JSON.stringify({ message: message, url: url, line: line, column: column }); var xhr = new XMLHttpRequest(); xhr.open("POST", "/i/js-error"); xhr.setRequestHeader("Content-Type", "application/json;charset=UTF-8"); xhr.send(data); }; }());