-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
32 lines (25 loc) · 741 Bytes
/
test.html
File metadata and controls
32 lines (25 loc) · 741 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
29
30
31
32
<!DOCTYPE html>
<html>
<head>
<title>Cosmoz 3</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/0.6.1/webcomponents.js"></script>
<link rel="import" href="404.html">
</head>
<body>
<button>Click me to 404 import</button>
<script>
var button = document.querySelector('button');
button.addEventListener('click', function () {
console.log('button click');
var importLink = document.createElement('link');
importLink.setAttribute('rel', 'import');
importLink.setAttribute('href', 'Another_404.html');
//importLink.setAttribute('async', '');
importLink.addEventListener('error', function () {
console.log('oops, wrong import');
});
document.head.appendChild(importLink);
});
</script>
</body>
</html>