I have looked at jTemplates and it\'s worth a try. Are there any other template engines other than jTemplates?
You can use this one: https://jocapc.github.io/jquery-view-engine/
It binds properties of JSON object into empty HTML template and match properties with elements by name, id, or class.
First, you would need to have plain HTML template in your page:
Then you need JS object that will be placed in template:
var data = { Name: "JOVN",
Desc: "The simplest view engine",
Tags: ["View engine", "JavaScript", "SPA"]
}
Finally just fill the view with the data object:
$("div#template").view(data);
Result is:
JOVN
- View engine
- JavaScript
- SPA
View engine will populate single fields or replicate array elements in template.