So I recently needed to import html to another html , and I'm also using Semantic UI for css.
(I wanted to make a menu with semantic ui and to activate the buttons so when I click them, they work)
So here is my code for header.html:-
<html>
<head>
<link rel="stylesheet" href="css/semantic/semantic.css"/>
<link rel="stylesheet" href="css/generic-style.css"/>
<link rel="stylesheet" href="css/style-profile.css"/>
<script src="js/jquery-3.1.0.min.js"></script>
<script src="js/semantic.min.js"></script>
</head>
<body>
<div class="ui menu no-borders menu2-padding" id="menu2">
<a class="green header link item">
<i class="shop icon"></i>
blah blah
</a>
<a class="green header link item">
<i class="shop icon"></i>
blah blah
</a>
<a class="green header link item">
<i class="shop icon"></i>
blah blah
</a>
</div>
<script>
$('.ui.menu a.item').on('click', function() {
$(this)
.addClass('active')
.siblings()
.removeClass('active');
})
</script>
</body>
</html>
And I used w3data.js to include this into another html file (profile.html) which its like this :-
<head>
<script src="js/jquery-3.1.0.min.js"></script>
<script src="http://www.w3schools.com/lib/w3data.js"></script>
</head>
<body>
<div w3-include-html="header.html"></div>
<script>
w3IncludeHTML();
</script>
</body>
And yet the styles are working fine but when I run the profile.html, the jquery inside the header file wont even work ( it just workes in the header.js itself not on the profile.html).
So any idea what should I do so the main html reads the script I have written ?