Return to Snippet

Revision: 33099
at October 6, 2010 04:12 by Nettuts

Initial Code
<html lang="en">
      <meta charset="UTF-8">
      <link rel="stylesheet" href="style.css" />

      <script src=""></script>
      <script src="jquery.tmpl.js"></script>

      <h1> Tweets about Nettuts+ </h1>

      <script id="tweets" type="text/x-jquery-tmpl">
            <img src="${imgSource}" alt="${userName}" />
            <h2> ${username} </h2>
            <p> ${tweet} </p>

            {{if geo}}

      <ul id="twitter"></ul>

            type : 'GET',
            dataType : 'jsonp',
            url : '',

            success : function(tweets) {
               var twitter = $.map(tweets.results, function(obj, index) {
                  return {
                     username : obj.from_user,
                     tweet : obj.text,
                     imgSource : obj.profile_image_url,
                     geo : obj.geo



Initial URL

Initial Description
This is quick code that demonstrates the usage of Microsoft's jQuery templating plugin.

Initial Title
Using the Official jQuery Templating Plugin

Initial Tags
javascript, plugin, jquery

Initial Language