I am loading a header with navigation menu using
jQuery(document).ready(function() {
$('#header').load("header.html");
});
and after this code I have the following
$(window).load(function() {
$('#about').addClass('active');
});
from everything I understand, the window.load
runs after document.ready
, but it's still not applying anything. Any help? The jquery for addClass
seems correct as when typed into a console after loading up the page in a browser, it works.
Is this a problem with the way I have set up my header template and loading it?
Previously I worked with php and some node.js, so re-using code was straightforward but I have a requirement to use pure html/js, hence the header template.
thanks