Skip to content

Instantly share code, notes, and snippets.

@cecilemuller
Created March 4, 2012 12:28
Show Gist options
  • Save cecilemuller/1972787 to your computer and use it in GitHub Desktop.
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