I was trying to reuse Navbar to all html page, so i try this code:
$(function(){
$('header').load('navbar.html');
});
And it was a success!
So i try to add navbar and footer at the same page then i try this:
$(function(){
$('header').load('navbar.html');
$('footer').load('footer.html');
});
But the only thing i see is the footer.
Can you help me to solve this?
I was trying to create my first project.
Top comments (4)
You need to have separate header and footer tags in you html like this
and then for example in script.js you can add the below code
which will give you the result which you're expecting
Hi fella!
I already did your recomendation but the result is still the same, but i still try again your recommendation but the result is still the same.
Im still a newbie๐
I appreciate your recommendation๐
I have created the code here. Check this out codesandbox.io/s/header-footer-jqu...
Many many thank you brother.๐