开发者

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 开发者_运维技巧.

I don't want to copy the html code for 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜