i've been tried some code :
a.html :
<div class="content">
<a href="howto_google_maps.asp">Google Maps</a><br>
<a href="howto_css_animate_buttons.asp">Animated Buttons</a><br>
<a href="howto_css_modals.asp">Modal Boxes</a><br>
<a href="howto_js_animate.asp">Animations</a><br>
<a href="howto_js_progressbar.asp">Progress Bars</a><br>
<a href="howto_css_dropdown.asp">Hover Dropdowns</a><br>
<a href="howto_js_dropdown.asp">Click Dropdowns</a><br>
<a href="howto_css_table_responsive.asp">Responsive Tables</a><br>
</div>
b.html (1st trial), i got this from w3schools :
<html>
<head>
<script src="js/jquery-3.3.3.min.js"></script>
<script>
function includeHTML() {
var z, i, elmnt, file, xhttp;
/*loop through a collection of all HTML elements:*/
z = document.getElementsByTagName("*");
for (i = 0; i < z.length; i++) {
elmnt = z[i];
/*search for elements with a certain atrribute:*/
file = elmnt.getAttribute("w3-include-html");
if (file) {
/*make an HTTP request using the attribute value as the file name:*/
xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4) {
if (this.status == 200) {elmnt.innerHTML = this.responseText;}
if (this.status == 404) {elmnt.innerHTML = "Page not found.";}
/*remove the attribute, and call this function once more:*/
elmnt.removeAttribute("w3-include-html");
includeHTML();
}
}
xhttp.open("GET", file, true);
xhttp.send();
/*exit the function:*/
return;
}
}
};
</script>
</head>
<body>
<p>Testing to call content from another html file</p>
<div w3-include-html="a.html"></div>
<script>
includeHTML();
</script>
</body>
</html>
b.html (2nd trial), while this i got from stackoverflow forum :
<html>
<head>
<script src="js/jquery-3.3.3.min.js"></script>
<script>
<script>
$(function(){
$("#includedContent").load("a.html");
});
</script>
</script>
</head>
<body>
<p>Testing to call content from another html file</p>
<div id="includeContent"></div>
</body>
</html>
but still don't work. do i have a mistake or something ? helping me to solve this i would appreciate it.
thanks in advance brothers/sisters.