load bottomnav from js
This commit is contained in:
5
_bottomnav.html
Normal file
5
_bottomnav.html
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<ul id="bottomnav">
|
||||||
|
<li><a href="/">[/]</a></li>
|
||||||
|
<li><a href="#">[/projects]</a></li>
|
||||||
|
<li><a href="#">[/links]</a></li>
|
||||||
|
</ul>
|
||||||
9
assets/global.js
Normal file
9
assets/global.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
const parser = new DOMParser();
|
||||||
|
|
||||||
|
fetch("/_bottomnav.html")
|
||||||
|
.then(response => response.text())
|
||||||
|
.then(text => {
|
||||||
|
const bottomNav = parser.parseFromString(text, "text/html");
|
||||||
|
|
||||||
|
document.body.appendChild(bottomNav.getElementById("bottomnav"));
|
||||||
|
});
|
||||||
@@ -5,6 +5,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Im bad at naming things</title>
|
<title>Im bad at naming things</title>
|
||||||
<link rel="stylesheet" href="assets/index.css">
|
<link rel="stylesheet" href="assets/index.css">
|
||||||
|
<script src="assets/global.js" defer></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<main>
|
<main>
|
||||||
@@ -13,10 +14,5 @@
|
|||||||
Lucielle
|
Lucielle
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
<ul id="bottomnav">
|
|
||||||
<li><a href="/">[/]</a></li>
|
|
||||||
<li><a href="#">[/projects]</a></li>
|
|
||||||
<li><a href="#">[/links]</a></li>
|
|
||||||
</ul>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user