forked from stacktracejs/stacktrace.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path27-2.html
More file actions
28 lines (27 loc) · 775 Bytes
/
Copy path27-2.html
File metadata and controls
28 lines (27 loc) · 775 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
26
27
28
<html>
<head>
<title>Issue #27</title>
<script src="../../stacktrace.js"></script>
<script>
/*function printStackTraceOnError(msg, file, line) {
alert(printStackTrace().join('\n\n'));
}
if (window.addEventListener) {
window.addEventListener('error', printStackTraceOnError, false);
} else if (window.attachEvent) {
window.attachEvent('onerror', printStackTraceOnError);
} else {
window.onerror = printStackTraceOnError;
}*/
window.onerror = function(msg, file, line) {
alert(printStackTrace().join('\n\n'));
};
function test() {
x += 1;
}
</script>
</head>
<body onload="test();">
<button onclick="test();">test</button>
</body>
</html>