As front-end development is becoming increasingly intensive and Ajax and JSON are used more and more frequently, you must use a large number of tags in front-end development. If it is simpleCodeThe combination may be better, but if the page uses a large number of similar structures, unless it is always the sameProgramPersonnel maintenance, otherwise the management cost will be relatively high in the future.
To solve this problem, we usually introduce the "javascript template engine concept".
There are several articles that introduce JavaScript front-end templates very well.ArticleShare with you:
First-glance front-end template:Http://www.baiduux.com/blog/2011/07/11/introduction-of-template/
How to select the Javascript template engine:Http://www.qianduan.net/how-to-choose-the-javascript-template-engine-javascript-template-engine.html
Acetemplate template:Http://blog.csdn.net/zswang/article/details/6582563
Yaya template:Http://www.uloveit.com.cn/template/
It's easy to read articles, but you can write them yourself.DemoThe most important task here is to share a few demos for you to learn and understand.
Acetemplate template: http://pan.baidu.com/share/link? Consumer id = 2542370481 & UK = 688556984
Yaya template: http://pan.baidu.com/share/link? Consumer id = 2539160601 & UK = 688556984