Get started with jsrender CDN
MIT licensed
JsRender is a JS templating engine for rendering HTML markup from data.
Tags:- jsrender
- node
- express
- hapi
- browserify
- templates
- template
Stable version
Copied!
How to start using jsrender CDN
// Include JsRender library
const script = document.createElement('script');
script.src = 'https://cdn.cdnhub.io/jsrender/1.0.13/jsrender.min.js';
document.head.appendChild(script);
// Wait for JsRender to load
JsRender.ready(function() {
// Prepare data
const data = {
name: 'John Doe',
age: 30,
hobbies: ['reading', 'swimming', 'coding']
};
// Define template
const template = `
<ul>
<li>Name: {{: name }}</li>
<li>Age: {{: age }}</li>
<li>Hobbies:</li>
<ul>
{{for hobby in hobbies}}
<li>{{: hobby }}</li>
{{/for}}
</ul>
</ul>
`;
// Compile template
const compiledTemplate = JsRender.compile(template);
// Render data to HTML
const output = compiledTemplate(data);
// Append rendered HTML to the body
document.body.innerHTML += output;
});
Copied!
Copied!
Copied!
All versions
0.9.71
0.9.72
0.9.73
0.9.74
0.9.75
0.9.76
0.9.77
0.9.78
0.9.79
0.9.80
0.9.81
0.9.82
0.9.83
0.9.84
0.9.86
0.9.87
0.9.88
0.9.89
0.9.90
0.9.91
1.0.0
1.0.0-beta
1.0.0-rc.65
1.0.0-rc.67
1.0.0-rc.68
1.0.0-rc.69
1.0.0-rc.70
1.0.1
1.0.10
1.0.11
1.0.12
1.0.13
1.0.14
*** 1.0.15
1.0.2
1.0.3
1.0.4
1.0.5
1.0.6
1.0.7
1.0.8
1.0.9