1
I’m having a problem to call my header and footer on all pages, because when I put in sub folders inside the project it just doesn’t pick up and I tried everything to my knowledge but I can not solve, the codes respectively js(jquery),header and footer and the index, however only the index would be outside of project subfolders as you can see in the image below however when I make the same call and organize link references does not work within subfolders that are sub menus that are also called in the index, how much code I’ll leave the link from the repository here : insert link description here
$(function(){
$("#header").load("menus/header.html");
$("#footer").load("menus/footer.html");
});
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="css/style.css"/>
</head>
<body>
<header>
<nav>
<div class="container">
<a href="index.html" class="logo"><img src="img/logo.png" id="tamlogo"></a>
<div id="divcabecalho"><img id="tamlupa" src="img/lupa.png">
<input type="text" id="inputcabecalho" placeholder="Buscar os melhores produtos nas melhores lojas..."
title="pesquise aqui">
<button id="botaoinput">Buscar</button>
</div>
<a class="login-a" href="" id="FormEntrar"><img src="img/users.png" class="filtro" id="user">ENTRAR</a>
<div class="nav-wrap">
<ul class="nav-left">
<li class="buttom"><a href="subMenus/teste.html">Celulares</a></li>
<li class="buttom"><a href="transistor.html">Tv e Audio</a></li>
<li class="buttom"><a href="horizon.html">Eletrodomesticos</a></li>
<li class="buttom"><a href="projectCars.html">Notebook</a></li>
<li class="buttom"><a href="sniper.html">Games</a></li>
</ul>
</div>
</div>
</nav>
</header>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="css/style.css"/>
</head>
<body>
<footer>
<div class="container">
<br/>
<a href="index.html"><img id="logo-footer" src="img/logo.png"/></a>
<table>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
</table>
<p><b>© 2018</b></p>
</div>
</footer>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="css/style.css"/>
<script src="js/jquery.js"></script>
<script src="js/menu.js"></script>
</head>
<body>
<div id="header"></div>
<div id="body"> so iria variar as paginas aqui</div>
<div id="footer"></div>
</body>
</html>
So, man, you got it sorted out?
– Lauro Moraes