title: How to make a smarty condition work in javascript?
body: <p>I having the following code in my JavaScript:</p>
  
  <pre><code>&lt;script&gt;
      {literal}
          // Wait for document to be ready before doing JS / Jquery magic
          $(document).ready(function() {
          // Check if the status is allowed to become changed | If so disable status select and force ticket closure
          if(
              {/literal}'{$ticket.lock_date}'{literal} != null
              &amp;&amp;
              {/literal}'{$currentDate}'{literal} &gt; {/literal}'{$ticket.lock_date}'{literal}
          ) {
              $('#status').attr("disabled", true);
              $('.select2project').attr("disabled", true);
              $('.select2lead').attr("disabled", true);
              $.ajax({
                  type: 'GET',
                  url: '/modules/support/ticketAutoclose.php?id='+'{/literal}{$ticket.id}{literal}'
              });
          }
  
          //more code down here
     {/literal}
  &lt;/script&gt;
  </code></pre>
  
  <p>The field in my DB at lock date is NULL. When I visit the document, the code above actives, even tho I specifically run at the first check "!= null".</p>
  
  <p>Anyone knows what I am doing wrong? It is really bogging me down in development.</p>