Jquery template. js front-end template engine, jquerytemplate. js
As a modern application, ajax is widely used, which makes it necessary for front-end engineers to assemble templates and render templates in daily development.
When there was a web, the front-end interaction with the back-end was very straightforward. The browser sent a URL and the back-end returned a assembled HTML string. The browser renders the image. Html may be mixed with some php (or some html in php ). Assemble data and templates on the server side to generate html strings to return to the browser side.
This is no different from a normal webpage. But now, we often use the template technology to solve the problem of front-end coupling.
The front-end uses the template engine to write some tags in html, which has nothing to do with data and logic. The backend parses these tags during rendering to generate HTML strings, such as smarty. In fact, the interaction between the frontend and the backend has already existed on the server.
The following is my own case. It is very intuitive to render the front-end page. You can copy it to see it.
Refer to GitHub for more information.Https://github.com/BorisMoore/jquery-tmpl
1 <! DOCTYPE html> 2