and if yes, what is the syntax? My goal is to prepend an \'s\' to the word \'comment\' when there is more than one. in an jQuery.ejs template in a JMVC app. The following br
Conditionals work if they're structured correctly, I ran into this issue and figured it out.
For conditionals, the tag before else has to be paired with the end tag of the previous if otherwise the statements will evaluate separately and produce an error.
ERROR!
<% if(true){ %>
foo
<% } %>
<% else{ %>
bar
<% } %>
Correct
<% if(true){ %>
foo
<% } else{ %>
bar
<% } %>
hope this helped.