Trying to load Bootstrap nav with jQuery. It doesn't work...
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<script>
$(function(){
$("#nav").load("nav.html");
});
</script>
</head>
<body>
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top" id="nav">
</nav>
And here is nav.html - simplified version. And it's not loaded.
<a class="navbar-brand" href="#">Menu</a>
I would wrap this into
$(document).ready(function() { ...yourFunction... });so that it's executed after the rest of the doc is loaded.