Any pure-front-end system help me reuse html?
For exmaple, I have 3 pages with the same structure:
banner
main content
footer
The banner
and footer
part are the same html, and main content
are different static html 开发者_运维技巧.
banner
and footer
to each page which makes the refactor of code hard. And I don't want back-end output methods. Thanks.I think the best answer so far was here:
Use
<?php include 'banner.html'; ?>
in a .php file and write the rest of it in static HTML. – Wesley Murch Aug 17 at 7:35
Technically, it's back-end code. But, technically, if nothing goes wrong, you won't have to bother back-end programmers. Keep your reusable static HTML in one place and call it when you need it.
Otherwise, I can't quite wrap my head around the idea of reusing server-side resources without calling on the back-end. It's basically a paradox.
精彩评论