title: How to call a javascript function from a <c:if block
body: <p>I want to call a javascript function when flow enters into <code>&lt;c:if&gt;</code> block.</p>
  
  <p>For example, I have below code:</p>
  
  <pre><code>&lt;c:if test="${!empty errorMessage &amp;&amp; !(fn:contains(errorMessage, 'generic'))}"&gt;
      &lt;span&gt; errorError occured&lt;br /&gt;
      &lt;/span&gt;
  &lt;/c:if&gt;
  </code></pre>
  
  <p>I need to invoke a JS function only when this <code>&lt;c:if&gt;</code> is true.</p>
  
  <p>Please suggest how to achieve this.</p>