Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall
The front-end template engine is popular with webmasters for its code readability and ease of maintenance. There are many template engines on the market, such as: mustache, JQuery Tmpl, Kissy template, Ejs, DoT, Ntenjin, etc. As technology progresses, these template engines are increasingly tailored to the user's experience requirements. At present, there is a new template juicer, since it is a new template, that it must have other templates do not have the new features, let's take a look at the next juicer.
Juicer most attention is its efficient performance, because the user's experience perception, directly affected by it. At the same time, juicer both the error handling mechanism and the security. Let's take a look at the performance comparisons of several major template engines on Jsperf.
With the above diagram, we can see clearly the advantages of juicer in performance. Here is a detailed introduction to the next juicer.
I. Security
Juicer to the data output security escape, to avoid the execution of malicious JS code. Follows
If the JSON data is returned by a Third-party interface or contains content from user input (such as BBS, evaluation), the first code will easily execute malicious code. Of course, if you do not want to be escaped, you can use $${varname}.
Ii. Error Handling
Error handling prevents subsequent JS code from being executed when the template engine compiles incorrectly. When Juicer encounters some of the JSON data's occasional errors, it only makes a warning at the console (Warn) to inform the developer that the template parsing error is not affecting the execution of subsequent code.
So efficient template engine, are you ready to be ready?
This article by the Zhengzhou wall painting: http://www.zzfeitian.com finishing release.