Skip to content

Instantly share code, notes, and snippets.

@joshbirk
Created November 30, 2011 23:32
Show Gist options
  • Save joshbirk/1411883 to your computer and use it in GitHub Desktop.
Save joshbirk/1411883 to your computer and use it in GitHub Desktop.
Using jQ's load to insert jQote2 templates remotely
<!Doctype html>
<HTML>
<HEAD>
<script src="jQuery-1.5.1.min.js" ></script>
<script src="jQuery.jQote2.min.js" ></script>
<script type="text/javascript">
j$ = jQuery.noConflict();
j$(document).ready(
function() {
j$('#contacts_tmpl').load('test_template.js', function() {
j$('#contactList').jqoteapp('#contacts_tmpl', [{"Name":"Test","Id":"asdasad"},{"Name":"Test2","Id":"asssffff"}]);
});
}
);
</script>
</HEAD>
<BODY>
<ul id="contactList">
<script type="text/x-jqote-template" id="contacts_tmpl" ></script>
</ul>
</BODY>
</HTML>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment