Partial render in HTML/JavaScript

前端 未结 5 2014
再見小時候
再見小時候 2020-12-24 07:17

I have some HTML files, and each one of them I want to partially render in another HTML file, for example header.html and footer.html in order to o

5条回答
  •  温柔的废话
    2020-12-24 08:06

    As others said, it looks like it can't be done with HTML alone. Another way it could be done on the server-side, if you are using Java, is with Thymeleaf.

    For example, adding a main menu on every page with

    . Then mainmenu.html could just contain a bunch of divs. The fragment doesn't need to be a full HTML page.

提交回复
热议问题