Working on a website, want to use the same header on each page. I am first trying it out by loading the files from my files system into the browser however this gives a problem with the following code (got it in this link):
code:
<html>
<head>
<title></title>
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script>
$(function(){
$("#header").load("header.html");
$("#footer").load("footer.html");
});
</script>
</head>
<body>
<div id="header"></div>
<!--Remaining section-->
<div id="footer"></div>
</body>
</html>
This doesn't seem to work, I read in the comments that this doesn't work anymore because of safety reasons.
Question:
Is there another way to solve this problem using Javascript/JQuery?