I working on the project now which will have massive multilevel menu – to make in easier to update in the future (site will be static html) I decide to stack menu in the separate file.
My question is:
- how to load whole content from external file in the
ulelement using jQuery?
E.g
HTML will be:
<ul class="menu">
</ul>
External file menu.html will look like:
<li><a href="index.html">Home</a></li>
<li><a href="index.html">Home</a></li>
<li><a href="index.html">Home</a></li>
<li><a href="index.html">Home</a></li>
<li><a href="index.html">Home</a></li>
Any help appreciated.
take a look to jQuery’s
.load()documentation.