After trying to separate the <header> and <footer> into external files, everything seemed to work fine in the console. However, when running the code, it ended up returning undefined.
This is the HTML for the Footer:
<footer id="footer" class="footer mt-auto py-3 bg-light">
<div class="container">
<div class="col-12 text-center">
<a style="text-anchor: middle">© 2021 AlexInCube</a>
</div>
</div>
Here's a snippet from main.html:
<script>document.write(importHTMLdata("content/basement.html"))</script>
The scripts.js file contains this function:
function importHTMLdata(path){
$.get(path, function(html_string)
{
console.log(html_string)
return html_string;
});