I can't make it work 🙂
<!DOCTYPE html>
<html lang="dk">
<head>
<title>Test Elowsson</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="w3.css">
<meta charset="utf-8">
<style>
</style>
<script>
function includeHTML() {
var z, i, elmnt, file, xhttp;
/* Loop through a collection of all HTML elements: */
z = document.getElementsByTagName("*");
for (i = 0; i < z.length; i++) {
elmnt = z;
/*search for elements with a certain atrribute:*/
file = elmnt.getAttribute("w3-include-html");
if (file) {
/* Make an HTTP request using the attribute value as the file name: */
xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4) {
if (this.status == 200) {elmnt.innerHTML = this.responseText;}
if (this.status == 404) {elmnt.innerHTML = "Page not found.";}
/* Remove the attribute, and call this function once more: */
elmnt.removeAttribute("w3-include-html");
includeHTML();
}
}
xhttp.open("GET", file, true);
xhttp.send();
/* Exit the function: */
return;
}
}
}
</script>
</head>
<body>
<div w3-include-html="header.html"></div>
<script>
includeHTML();
</script>
<div class="w3-main w3-container">
<div class="w3-bar w3-black">
<a href="lasersk.html" target="_parent" class="w3-bar-item w3-hover-green">Laserskære</a>
<a href="#" class="w3-bar-item w3-hover-green">Paris</a>
<a href="#" class="w3-bar-item w3-hover-green">Tokyo</a>
</div>
</div>
<br>
<footer class="w3-container w3-teal">
<h5>Footer</h5>
<p>Footer information goes here</p>
</footer>
</body>
</html>
<!DOCTYPE html>
<html lang="dk">
<head>
<title>Header</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="w3.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<meta charset="utf-8">
<style>
</style>
</head>
<body>
<!-- Top menu -->
<header class="w3-top">
<div class="w3-white w3-xlarge" style="margin:auto">
<div class="w3-padding-16 w3-left" style="margin-left: 10px;">
<a href="index.html" class="logo">
<img src="Billeder/Logo/logo_ny.png" alt="logo" height="80" width="220" >
</a>
</div>
<div class="w3-right w3-padding-16">
<a href="index.html">
<ul class="w3-ul">
<li class="w3-xxlarge"><i class="fa fa-home"></i></li>
</ul>
</a>
</div>
<div class="w3-center w3-padding-16">
<h2 style="font-size: 25px; font-weight: bold;">Hvad vi kan bidrage med.</h2>
<p style="font-size: 10px;">Siden er under opbygning, vi koder alt selv i "rå" Html,css.
<br />
Ikke optimeret for Mobil og tablet endnu.
</p>
</div>
</div>
</header>
</body>
</html>