Comparison and Application of JS template engine BaiduTemplate and ArtTemplate

Source: Internet
Author: User

Comparison and Application of JS template engine BaiduTemplate and ArtTemplate
Recently, I used the JS template engine to render HTML. The JS template engine was known to be used for projects last year, but it has never been used. It only stays at the level of understanding, it was not used until this project was completed. The JS template engine used two baidutemplates and ArtTemplate. The BaiduTemplate engine was used at the beginning of the project. After the project was completed, it was released to the Internet. When it was found that the loading speed was slow due to a large amount of data, it was considered whether another template engine could improve the rendering efficiency, after searching and comparing on the internet, I found that ArtTemplate is better, so I learned a little more about it. The syntax of the two engines is a little different, but the result is as follows, the following describes how to use two engines: BaiduTemplate Code introduces the copy Code <script type = "text/javascript"> var html; var bt = baidu. template; $ (function () {$. ajax ({type: "GET", url: "/Json/Analysis. js ", dataType: 'json', success: function (data) {html = bt ('t: Jtlm_Analysis ', {list: data}); document. GetElementById ('jtlm _ analytic '). innerHTML = html ;}}) ;}); </script> copy a custom code template and copy the Code <script id = "t: jtlm_Analysis "type =" text/html "> <% for (var I = 0; I <list. length; I ++) {%> <div class = "widget-box transparent collapsed"> <div class = "widget-header-flat">

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.