Skip to content

Instantly share code, notes, and snippets.

@akb
Created January 31, 2011 17:59
Show Gist options
  • Select an option

  • Save akb/804479 to your computer and use it in GitHub Desktop.

Select an option

Save akb/804479 to your computer and use it in GitHub Desktop.
Client-side pseudo-jquery template example
<html>
<head>
<title></title>
<script src="jquery.js"></script>
<script type="text/jqtpl" id="item">
<h1>{{ title }}</h1>
<p>Name: {{ name }}</p>
</script>
<script>
var counter = 0;
$("#foo").append(
counter = counter + 1;
$.template("item", { "title-" + counter : "Title", "name" : "Bob"});
).change(function () {
});
</script>
</head>
<body>
<div id="foo"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment