Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="game-container"></div>
- <script src="js/jquery-2.1.0.min.js"></script>
- <script src="js/underscore.js"></script>
- <script type="text/template" id="template">
- <h2>
- <%- rc.name %>
- </h2>
- </script>
- <script type="text/javascript">
- // Grab the HTML out of our template tag and pre-compile it.
- var template = _.template(
- $( "#template" ).html()
- );
- // Define our render data (to be put into the "rc" variable).
- var templateData = {
- rc : {
- name: "Alex"
- }
- };
- // Render the underscore template and inject it after the H1
- // in our current DOM.
- $( ".game-container" ).after(
- template( templateData )
- );
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement