简体   繁体   中英

ejs templating engine data rendering error

<div class="form-group">
<div class="input-group">
 <span class="input-group-addon"><i class="fa fa-hashtag"></i></span>
  <%
 <input id="vvcode" type="hidden" class="form-control" name="requestId" 
value="
<%= 
requestId %>" required/> 
%>
</div>
</div>

i'm getting a "Could not find matching close tag for \\"<%\\"." error. please help, what am i doing wrong?

The error is quite specific.

You have an opening control flow <% but then you mix some html without closing it with %>

You should either do something inside like:

<% if (something) { %>
Html content
<% } %>

Or just remove them:

<div class="form-group">
    <div class="input-group">
        <span class="input-group-addon"><i class="fa fa-hashtag"></i></span>
        <input id="vvcode" type="hidden" class="form-control" name="requestId" value="<%= requestId %>" required/> 
    </div>
</div>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM