-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.html
More file actions
37 lines (33 loc) · 1.24 KB
/
demo.html
File metadata and controls
37 lines (33 loc) · 1.24 KB
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
29
30
31
32
33
34
35
36
37
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Stacklyn Demo</title>
<script src="https://cdn.jsdelivr.net/npm/stacklyn/stacklyn.js"></script>
<style>
body { font-family: sans-serif; padding: 1em; background: #f9f9f9; }
button { padding: 0.5em 1em; font-size: 1em; margin-bottom: 1em; }
pre { background: #1e1e1e; color: #dcdcdc; padding: 1em; overflow-x: auto; border-radius: 6px; }
h2 { margin-top: 2em; }
</style>
<script>
function throwErr() {
try {
undefunc(); // undefined function
} catch (e) {
document.getElementById("raw").textContent = e.stack;
document.getElementById("parsed").textContent = JSON.stringify(Stacklyn.parse(e), null, 4);
}
}
</script>
</head>
<body>
<h1>Stacklyn Demo</h1>
<button onclick="throwErr()">Throw Error & Parse</button>
<h2>Raw Stack</h2>
<pre id="raw">Press the button to see the raw stacktrace.</pre>
<h2>Parsed by Stacklyn</h2>
<pre id="parsed">Press the button to see the parsed output.</pre>
</body>
</html>