Skip to content

Instantly share code, notes, and snippets.

@cecilemuller
Created March 4, 2012 12:28
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save cecilemuller/1972787 to your computer and use it in GitHub Desktop.
Static template via a SCRIPT tag, using Jquery Templates
<!--
Works even without the "plus" extension of the Templates plugin.
http://github.com/nje/jquery-tmpl
-->
<script id="MyStaticTemplate" type="text/x-jquery-tmpl">
<div>Hello ${hello}</div>
</script>
<script>
var MyData = {hello: "world"};
$("#MyStaticTemplate").tmpl(MyData).appendTo("#contents");
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment