title: use json list element inside a jinja statement using js or jquery
body: <p>this is my code:</p>
  <pre><code>                $(&quot;select&quot;).change(function(){
                  $.post(&quot;/sort&quot;, {sort:$(this).val()}, function(table_data)
                  {
                      for (let i in table_data)
                      {
                          var tr = $(&quot;&lt;tr/&gt;&quot;);
                          var filename = table_data[i].filename;
                          var size = table_data[i].size;
                          var uploaded = table_data[i].upload_time;
                          tr.append(&quot;&lt;td&gt;&quot;+filename+&quot;&lt;/td&gt;&quot;);
                          tr.append(&quot;&lt;td&gt;&quot;+size+&quot;&lt;/td&gt;&quot;);
                          tr.append(&quot;&lt;td&gt;&quot;+uploaded+&quot;&lt;/td&gt;&quot;);
                          **tr.append(&quot;&lt;td&gt;&quot;+&quot;&lt;a href='{{url_for('.download', filename=***filename***)}}'&gt;&quot;+'Download'+&quot;&lt;/a&gt;&quot;+&quot;&lt;/td&gt;&quot;)**;
                          tr.appendTo(table);
                      }
  </code></pre>
  <p>Interestingly the jinja statement inside the js statement works, the browser directs to that path, but the filename remains None, because the server, which is using python flask, cannot resolve the value sent from here which is a js variable. Table_data is a json that was returned from the server using jsonify in response to an ajax call. My question is if there's any way to use that 'filename' js variable inside that jinja statement, or perhaps convert it to a jinja variable. Thanks.</p>