Sha256: f84d4cf872079ed7bf8dc57a00edf776ef930a2edc982e863b87e053769b9ec4
Contents?: true
Size: 1.47 KB
Versions: 15
Compression:
Stored size: 1.47 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="03_compiled-template.html">Prev</a> <a href="index.html">Home</a> <a href="05_input.html">Next</a><br /> <h3>4 Data Arrays</h3> <!--====== Container ======--> <table><tbody id="details"></tbody></table> <!--====== Template ======--> <script id="personTmpl" type="text/x-jsrender"> <tr> <td>{{:firstName}}</td> </tr> </script> <!--====== Script ======--> <script type="text/javascript"> var people = [ { firstName: "Jeff" }, { firstName: "Rebecca" } ]; // An array renders once for each item (concatenated) var html = $( "#personTmpl" ).render( people ); // Insert as HTML $( "#details" ).html( html ); </script> <!--================ End of Demo Section ================--> <h4>Data:</h4> <pre class="brush: js;"> var people = [ { firstName: "Jeff" }, { firstName: "Rebecca" } ]; </pre> <h4>Script:</h4> <pre class="brush: js;"> // An array renders once for each item (concatenated) var html = $( "#personTmpl" ).render( people ); // Insert as HTML $( "#details" ).html( html ); </pre> </body> </html>
Version data entries
15 entries across 15 versions & 1 rubygems