-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
43 lines (39 loc) · 1.33 KB
/
test.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<html>
<head>
<script type="text/javascript">
setTimeout(() => {
const image = document.createElement("img");
image.setAttribute("id", "dynamic-image");
image.setAttribute("src", "https://i.imgur.com/aEFogmG.jpg");
image.setAttribute("title", "raccoon and fawn friends");
image.setAttribute("alt", "raccoon and fawn friends");
image.onerror = function (error) {
console.error("Failed to load image");
console.error(error);
document.getElementById("error").innerText = "Failed to load image";
};
const link = document.createElement("a");
link.setAttribute("href", "https://i.imgur.com/aEFogmG.jpg");
link.appendChild(image);
document.getElementById("image-container").appendChild(link);
}, 2000);
</script>
</head>
<body>
<main style="display: flex; flex-direction: column">
<a href="https://i.imgur.com/aEFogmG.jpg">
<img
src="https://i.imgur.com/aEFogmG.jpg"
alt="raccoon and fawn friends"
title="raccoon and fawn friends"
id="static-image"
/>
</a>
<div id="image-container">
<p>Dynamically added image:</p>
<div id="error"></div>
</div>
<iframe src="iframe.html"></iframe>
</main>
</body>
</html>