-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjavascript.js
More file actions
34 lines (30 loc) · 971 Bytes
/
javascript.js
File metadata and controls
34 lines (30 loc) · 971 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
33
34
// Define your header and footer content here
const headerContent = `
<header>
<p>
<h2>Bros112's Website</h2>
</p>
</header>
`;
const footerContent = `
<footer>
<br><br><br>
<p>
<a href="/">Home</a><a href="/help">Help</a><br>
Updated <strong>29th Aug 2023</strong> <br>
© 2023<script>new Date().getFullYear()>2023&&document.write("-"+new Date().getFullYear());</script> Bros112
</p>
</footer>
`;
// Function to add header and footer
function addHeaderFooter() {
const headerPlaceholder = document.getElementById("header-placeholder");
const footerPlaceholder = document.getElementById("footer-placeholder");
// Insert header and footer content into the placeholders
if (headerPlaceholder){
headerPlaceholder.innerHTML = headerContent}
if (footerPlaceholder){
footerPlaceholder.innerHTML = footerContent}
}
// Call the function to add header and footer when the page is loaded
window.addEventListener("load", addHeaderFooter);