-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy patherror.js
More file actions
executable file
·25 lines (20 loc) · 756 Bytes
/
error.js
File metadata and controls
executable file
·25 lines (20 loc) · 756 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
window.onerror = (function (server_script) {
"use strict";
return function (error, file, line) {
var err, params, script;
if (typeof jQuery !== 'undefined') {
params = {
error : error,
file : file,
line : line
};
jQuery.get(server_script, params);
} else {
err = document.createElement('script');
err.src = server_script + '?line=' + line + '&file=' + encodeURIComponent(file) + '&error=' + encodeURIComponent(error);
script = document.getElementsByTagName('script')[0];
script.parentNode.insertBefore(err, script);
}
return false;
};
}('/report-errors.php'));