Skip to content

Commit 8eb6008

Browse files
authored
Add 404
1 parent 1f63ae1 commit 8eb6008

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

404.html

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<html>
2+
<body>
3+
You sent our website the following info:
4+
5+
</body>
6+
<script>
7+
// 1. Get the URL fragment (hash)
8+
const fragment = window.location.hash;
9+
10+
// 2. Check if a fragment exists
11+
if (fragment) {
12+
const base64EncodedString = fragment.substring(1);
13+
14+
try {
15+
// 3. Base64 decode the string using atob()
16+
const decodedString = atob(base64EncodedString);
17+
18+
// 4. Create a new element to append the content (e.g., a div or p tag)
19+
const newElement = document.createElement('div');
20+
newElement.textContent = decodedString;
21+
newElement.style.padding = '20px';
22+
newElement.style.border = '1px solid black';
23+
24+
// 5. Append the new element to the document body
25+
document.body.appendChild(newElement);
26+
27+
console.log("Decoded and appended:", decodedString);
28+
29+
} catch (error) {
30+
// Handle cases where the string might not be valid Base64
31+
console.error("Failed to decode Base64 string:", error);
32+
}
33+
} else {
34+
console.log("No URL fragment found.");
35+
}
36+
</script>
37+
</html>

0 commit comments

Comments
 (0)