title: Adding dynamic value to a function
body: <p>I am trying to implement a plugin:</p>
  
  <pre><code>$(".myTbl th:nth-child(1)").truncate({
          width: "200",
          after: "&amp;hellip;",
          center: false,
          addtitle: true
  });
  </code></pre>
  
  <p>Instead of using a fixed value for width, I have a script that calculates it dynamically and sets it into a a variable, but when I plug it in the code breaks. What am I missing? it is all withing PHP code</p>
  
  <pre><code>echo '
  
  var myWidth = 150;
  
  $(".myTbl th:nth-child(1)").truncate({
          width: myWidth ,
          after: "&amp;hellip;",
          center: false,
          addtitle: true
  }); ';
  </code></pre>