title: How can I pass a javascript variable through a function with Smarty?
body: <p>I am trying to pass a parameter to a function with <code>Smarty</code>. Like this:</p>
  
  <pre><code>$('#buttonClose').click(function(){
      var name = document.getElementById('nameSpan').value;
      {$person-&gt;addName(name)}
  });
  </code></pre>
  
  <p>but it pass the value "name" instead of the real value of the variable <code>name</code>. </p>
  
  <p>How can I do that to get the real value of the variable <code>name</code> in the function <code>addName</code>?</p>
  
  <p>Thanks in advance!</p>