title: jQuery template issue with JSON data
body: <p>I'm using jQuery templating which is taking JSON data to create a table. This code is working fine. But when I try to create a function around this code and pass JSON data to it which I'm getting from an AJAX request, it shows the values in the console but not in the table. Working code with dummy data is:</p>
  
  <pre><code>var json = [{"class":12,"marks":"500","marks1":"200","marks2":"300"},{"class":11,"marks":"200","marks1":"300","marks2":"400"}]
  
  $.template('kList','&lt;tr title="${class}"&gt;&lt;td&gt;${marks}&lt;/td&gt;&lt;td&gt;${marks1}&lt;/td&gt;&lt;td&gt;${marks2}&lt;/td&gt;&lt;/tr&gt;');  
  
  for(var i=0; i&lt;json.length; i++){   
      $.tmpl('kList',json[i]).appendTo("#table1")
  }
  </code></pre>
  
  <p>Here is the code where I'm warping the upper code in function and passing the JSON data as a parameter that shows the values in console when I print it with <code>console.log(json)</code> but not filling the table. The JSON parameter is having the same JSON data as in above code.</p>
  
  <pre><code>function dataTable(json){
      console.log(json); // here json values are appearing in the console
      $.template('kList','&lt;tr title="${class}"&gt;&lt;td&gt;${marks}&lt;/td&gt;&lt;td&gt;${marks1}&lt;/td&gt;&lt;td&gt;${marks2}&lt;/td&gt;&lt;/tr&gt;');  
  
      for(var i=0; i&lt;json.length; i++){   
          $.tmpl('kList',json[i]).appendTo("#table1")
      }
  }
  </code></pre>
  
  <p>Please help me out because I don't know whats wrong in this code. Thanks in advance.</p>