I have successfully included my header and footer in separate HTML files using jQuery's .load()
function. The jQuery code I used is shown below:
$(function(){
$("#header").load("page-component/header.html");
$("#footer").load("page-component/footer.html");
});
However, I am facing an issue where I cannot seem to add an active
class to one of the header or footer links when navigating to another page. Can anyone provide assistance with this problem?
I attempted the following code but it did not work as intended:
$(document).ready(function(){
jQuery('#menu-about').addClass('active');
});