Skip to content

Instantly share code, notes, and snippets.

@pinscript
Created June 15, 2011 07:49
Show Gist options
  • Save pinscript/1026661 to your computer and use it in GitHub Desktop.
Save pinscript/1026661 to your computer and use it in GitHub Desktop.
html_data += '<li>';
html_data += '<a title="' + item.text + '" class="twitter item-' + i + '" href="' + item.url + '">';
html_data += '<img src="' + item.thumbnail + '" />' + '<span>' + item.date + '</span>' + item.text;
html_data += '</a>';
html_data += '</li>';
Kan bli:
<script id="twitter-template" type="text/x-jquery-tmpl">
<li>
<a title="${item.text}" class="twitter item-${i}" href="${item.url}">
<img src="${item.thumbnail}" />
<span>${item.date}</span>
</a>
</li>
</script>
$("#twitter-template").tmpl({item: item, i: i});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment