So the structure of my web page is split into three files. I have an index.html file with 3 divs; My navigation bar, a content box, and footer. Then I have two other .html files with different content that I want to load when clicking on links.
My Javascript looks like this:
$( ".content" ).load( "home.html" );
$( ".parents-link" ).click(function() {
$( ".content" ).load( "parents.html" );
});
$( ".home-link" ).click(function() {
$( ".content" ).load( "home.html" );
});
All files use some javascript and when I first open index.html everything works perfectly fine, but once I start clicking on the links the javascript doesn't fire anymore in the content div. My navigation bar in index.html uses javascript and still works regardless.
also, all my custom js is in one .js file for all three .html files. I'm also using some plugins.
How can I fix this issue?