This article mainly introduces the jQuery-based JavaScript template engine JsRender User Guide. For more information, see the following introduction.
JsRender is a jQuery-based JavaScript template engine with the following features:
· Simple and intuitive
· Powerful functions
· Scalable
· Lightning fast
These features seem very powerful, but almost every template engine will do so...
This template engine is available only when you need to work. After using it for a while, I found that it is indeed quite powerful. However, it is hard to understand that it is too powerful in some places.
On the other hand, JsRender's official documents are relatively detailed, but there are surprisingly few other materials. if you encounter any problems, you cannot find them. not only are you unable to find relevant questions, but there are almost no results.
In addition, JsRender is hard to understand in some places, so we urgently need to share some "best practices ".
Based on the recent usage, I have summarized some practical experiences. of course, these experiences cannot be found in official documents.
Note: This document is not a basic getting started tutorial. in the following example, you can leave a comment without too many instructions.
Nested loop use # parent access to parent-level data (not recommended)
The code is as follows:
Use nested loops # Use parent to access parent data --- by Yang Yuan
Serial Number |
Name |
Family members |