I tried to put <header> and <footer> in external files. In the console, the code outputs fine, but then the code returns undefined.
Footer HTML:
<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>
main.html
<script>document.write(importHTMLdata("content/basement.html"))</script>
scripts.js
function importHTMLdata(path){
    $.get(path, function(html_string)
    {
        console.log(html_string)
        return html_string;
    });
 
    