I can't assign HTML properly using jQuery.tmpl(). If i pass value of something as html tag it is rendered as as it is instead of HTML tags rendered on page
<div id="window">
<script id="lines" type="text/x-jquery-tmpl">
<div id="${id}" class="line ${type}"><span>${name}</span>: ${body}</div>
</script>
</div>
var line = {
name: 'John',
body: '<strong>hello</strong>
};
$('#lines').tmpl(line).appendTo('#window');
Selvakumar Arumugam. JQuery templating is a fast and efficient technique to render client-side templates using a JSON data source. It refers to the client-side data binding method with the JQuery. JQuery templating is a fast and efficient technique to render client-side templates using a JSON data source.
React's goal is in many ways to render HTML in a web page. React renders HTML to the web page by using a function called ReactDOM. render() .
Rendering is a process used in web development that turns website code into the interactive pages users see when they visit a website. The term generally refers to the use of HTML, CSS, and JavaScript codes. The process is completed by a rendering engine, the software used by a web browser to render a web page.
You can wrap the template variable with {{html body}}
to override the default encoding behavior.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With