Skip to content

Instantly share code, notes, and snippets.

@brito
Created February 7, 2011 05:27
Show Gist options
  • Save brito/814035 to your computer and use it in GitHub Desktop.
Save brito/814035 to your computer and use it in GitHub Desktop.
Requires jquery (not included)
<script src="jquery.js"></script>
Include gNius library
<script src="gNius.js"></script>
Your application data:
<script>
var articles = [
{ title: "gNius Library launched!", icon: "gNius.png", summary: "Lorem ipsum..." },
{ title: "Website looks almost decent!", icon: "website.png", summary: "Lorem ipsum..." },
{ title: "Starter code initiated!", icon: "code.png", summary: "Lorem ipsum..." },
];
</script>
Markup:
<article>
<h2>$title</h2>
<img src="$icon" />
<p>$summary</p>
</article>
Magic:
<script>
$('article').interpolate(articles);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment