-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsvg-errors.html
28 lines (28 loc) · 919 Bytes
/
svg-errors.html
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>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<style>
svg {
background-color: #c1f75d;
}
textarea {
width: 100%;
min-height: 50%;
}
</style>
</head>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="200px" height="200px">
<rect class="block" x="50" y="50" fill="#ff6347" width="100" height="100"/>
</svg>
<script>
try {
// this line has a `path` error
document.getElementsByTagName('body')[0].outerHTML += `<svg x="0px" y="0px" width="200px" height="200px"><path d="M10,10 H20 V20 H10 V20 MMM" fill="#999999" /></svg>`;
}
catch (error) {
// This is not called ☹️
alert('There was an error!');
}
</script>
</body>
</html>