title: Evaluate DustJS variables from jquery
body: <p>I want to append some HTML containing DustJS variables using jQuery. Here is what I am trying to do in jQuery:</p>
  
  <pre><code>$(document).on('ready', function(){
      $("tr").click(function(){
          $(this).after('&lt;tr class="row-details"&gt;\
                            &lt;td&gt;&lt;/td&gt;\
                            &lt;td colspan="4"&gt;\
                              &lt;table class="sortable draggable"&gt;\
                                &lt;thead&gt;\
                                    &lt;tr&gt;\
                                        &lt;th class="col-itemName"&gt;Item Name&lt;/th&gt;\
                                        &lt;th class="col-quantity"&gt;Quantity&lt;/th&gt;\
                                        &lt;th class="col-rate"&gt;Rate&lt;/th&gt;\
                                        &lt;th class="col-amount"&gt;Amount&lt;/th&gt;\
                                    &lt;/tr&gt;\
                                &lt;/thead&gt;\
                                &lt;tbody&gt;\
                                    {#items}\
                                      &lt;tr&gt;\
                                        &lt;td&gt;{.item.itemName}&lt;/td&gt;\
                                        &lt;td&gt;{.quantity}&lt;/td&gt;\
                                        &lt;td&gt;{.rate}&lt;/td&gt;\
                                        &lt;td&gt;{@math key="{.quantity}" method="multiply" operand="{.rate}"/}&lt;/td&gt;\
                                      &lt;/tr&gt;\
                                    {/items}\
                                &lt;/tbody&gt;\
                              &lt;/table&gt;\
                            &lt;/td&gt;\
                          &lt;/tr&gt;');
      });
    });
  </code></pre>
  
  <p>Here is my output:</p>
  
  <p><a href="https://i.stack.imgur.com/QmNZr.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QmNZr.jpg" alt="enter image description here"></a></p>
  
  <p>How do I evaluate those variables???</p>