title: understanding Jquery template
body: <p>I am reading and trying to understand a Jquery template example.</p>
  
  <pre><code>&lt;script id="movieTemplate" type="text/x-jquery-tmpl"&gt; 
    {{tmpl "titleTemplate"}}
    &lt;tr class="detail"&gt;&lt;td&gt;Director: ${Director}&lt;/td&gt;&lt;/tr&gt;
  
  &lt;/script&gt;
  
  &lt;table&gt;&lt;tbody id="movieList"&gt;&lt;/tbody&gt;&lt;/table&gt;
  
  &lt;script&gt;
  var movies = [
    { Name: "The Red Violin", Director: "François Girard" ,Producer : "ssss" },
    { Name: "Eyes Wide Shut", Director: "Stanley Kubrick" },
    { Name: "The Inheritance", Director: "Mauro Bolognini" }
  ];
  
  /* Convert the markup string into a named template,
     referenced by the {{tmpl}} tag */
  $.template( "titleTemplate", "&lt;tr class='title'&gt;&lt;td&gt;${Name}&lt;/td&gt;&lt;/tr&gt;" );
  
  /* Render the movies data, using the named template as a nested template */
  $( "#movieTemplate" ).tmpl( movies ).appendTo( "#movieList" );
  &lt;/script&gt;
  </code></pre>
  
  <p>In this example program I am not able to understand about the:</p>
  
  <p>/* Convert the markup string into a named template,
     referenced by the {{tmpl}} tag */</p>
  
  <p>when we call:
  $( "#movieTemplate" ).tmpl( movies ) it is calling the template on that we are calling the template function with input movies and appending that to movieslistid</p>
  
  <p>if I remove the code </p>
  
  <pre><code>$.template( "titleTemplate", "&lt;tr class='title'&gt;&lt;td&gt;${Name}&lt;/td&gt;&lt;/tr&gt;" );
  </code></pre>
  
  <p>it does not work. Can you please explain why we need this and what is it doing here like what does: /* Convert the markup string into a named template, mean and all..</p>
  
  <p>I tried to readonline and found that I am not getting this clarified</p>