Sha256: 5e3b0e048868dbbf040fb08688b892a46e63798f838b24b6f941114f17b9a9b1
Contents?: true
Size: 1.41 KB
Versions: 15
Compression:
Stored size: 1.41 KB
Contents
<!DOCTYPE html> <html> <head> <link href="resources/presentation.css" rel="stylesheet" type="text/css" /> <link href="resources/syntaxhighlighter.css" rel="stylesheet" type="text/css" /> <script src="resources/syntaxhighlighter.min.js" type="text/javascript"></script> <script src="http://code.jquery.com/jquery.js" type="text/javascript"></script> <script src="../../jsrender.js" type="text/javascript"></script> </head> <body> <a href="02_template-from-string.html">Prev</a> <a href="index.html">Home</a> <a href="04_data-array.html">Next</a><br /> <h3>3 Compile template from string</h3> <!--====== Container ======--> <table><tbody id="details"></tbody></table> <!--====== Script ======--> <script type="text/javascript"> var person = { firstName: "Jeff" }; // Compile from string, as named template $.templates( "detailsTmpl", "<tr><td>{{:firstName}}</td></tr>" ); // Render to string var html = $.render.detailsTmpl( person ); // Insert as HTML $( "#details" ).html( html ); </script> <!--================ End of Demo Section ================--> <h4>Data:</h4> <pre class="brush: js;"> var person = { firstName: "Jeff" }; </pre> <h4>Script:</h4> <pre class="brush: js;"> // Compile as named template $.templates( "detailsTmpl", "<tr><td>{{:firstName}}</td></tr>" ); // Render to string var html = $.render.detailsTmpl( person ); // Insert as HTML $( "#details" ).html( html ); </pre> </body> </html>
Version data entries
15 entries across 15 versions & 1 rubygems