Code Repeat for Navbar HTML

0

Good evening, brothers! I have a website with a navbar stylized and adapted with the colors and symbols of the client. However, since there are several pages, the navbar code is being repeated in all of them, and it is several lines of code. I would like to know in some way that I can include navbar without copying and pasting the code toooodo. PS: I know that with PHP this is possible, but I did not want to use php ... I know there is a way to do it for jQuery, it was the one I was looking for.

Thank you!

    
asked by anonymous 12.07.2018 / 02:13

1 answer

1

There is the load () method of jQuery.

<html>
<head>
  <title>Load jQuery</title>
  <script src="http://code.jquery.com/jquery-2.1.4.min.js"></script><script>$(function(){$("#menu").load("menu.html");
    });
  </script>
</head>

<body>
  <div id="menu">
    Menu...
  </div>

  <div></div>

Would that be?

    
12.07.2018 / 02:30