Answers for "how to get nav bar to load multiple html pages"

1

navigation bar on more than one page

<!-- add in head: --> <script src="https://code.jquery.com/jquery-1.10.2.js"></script>

<!--Navigation bar-->
<div id="nav-placeholder">

</div>

<script>
$(function(){
  $("#nav-placeholder").load("nav.html");
});
</script>
<!--end of Navigation bar-->
Posted by: Guest on December-16-2020
1

navbar multiple pages

<script src="//code.jquery.com/jquery.min.js"></script>
<script>
$.get("navigation.html", function(data){
    $("#nav-placeholder").replaceWith(data);
});
</script>
Posted by: Guest on November-14-2020

Browse Popular Code Answers by Language