我收到EJS错误说 - 找不到'%; lt;%;
我已经检查了有关嵌套标签等潜在原因的互联网。以前有,但我已经删除了它们。某些地方用户实际上忘记了关闭标签,但是我手动检查了每个标签,但是每个开头标签都有一个关闭标签。
有一些IF-ELSE语句和一个循环。我检查了使用循环和if-else语句的语法,并将语法制成了Internet上的SAW。
不过,我遇到了这个问题。 这是我的代码。
<header>
<div class="logoPlant">
<img
src=""
width="160"
/>
<%=Plant%>
</div>
<h3>
<% if (GatePassType === "RGP") { %> RETURNABLE GATE PASS <% } else {
%> NON RETURNABLE GATE PASS <% } %>
</h3>
</header>
<div class="data">
<div class="left">
<div class="line">
<p>Gate Pass No</p>
:
<p><%=GatePassNo%></p>
</div>
<div class="line">
<p>Issued By</p>
:
<p><%=DepartmentName%></p>
</div>
</div>
<div class="right">
<div class="line">
<p>Gate Pass Date</p>
:
<p><%=GatePassDate%></p>
</div>
<div class="line">
<p>Issued To</p>
:
<p><%=PartyName%></p>
</div>
</div>
</div>
<table>
<tr>
<th>Item Name</th>
<th>Unit</th>
<th>Out</th>
<% if (GatePassType === "RGP") { %>
<th>Exp Ret. Date</th>
<% } %>
<th>Purpose</th>
</tr>
<% for(let i = 0; i < Items.length; i++) { %>
<tr>
<td><%= Items[i].ItemCode Items[i].ItemName %></td>
<td><%= Items[i].Unit %></td>
<td><%= Items[i].Quantity%></td>
<% if (GatePassType === "RGP") { %>
<td><%=Items[i].ReturnDate%></td>
<% } %
<td><%= Items[i].Remarks %></td>
</tr>
<% } %>
</table>
<footer>
<p>
N.B.: Carrier to be produce his copy at security office while
returning the material to the factory.
</p>
<div class="two">
<p><%=InitiatorEName%></p>
<p><b>Initiated By</b></p>
<br />
<p><%=ApproverEName%></p>
<p><b>Authorized By</b></p>
</div>
<div class="two">
<p><%=CarrierString%></p>
<p><b>Carrier Name</b></p>
<br />
<p><%=MainGateEname%></p>
<p><b>Security By</b></p>
</div>
</footer>
I have checked the internet about potential causes like nested tags. There were before but I have removed them. Some place users have actually forgotten to close the tag, but I checked manually each tag but and every opening tag has a closing tag.
There are some if-else statements and one loop. I checked the syntaxes for using loops and if-else statements and made the syntaxes as saw on the internet.
Still, I am getting this issue.
Here is my Code.
<header>
<div class="logoPlant">
<img
src=""
width="160"
/>
<%=Plant%>
</div>
<h3>
<% if (GatePassType === "RGP") { %> RETURNABLE GATE PASS <% } else {
%> NON RETURNABLE GATE PASS <% } %>
</h3>
</header>
<div class="data">
<div class="left">
<div class="line">
<p>Gate Pass No</p>
:
<p><%=GatePassNo%></p>
</div>
<div class="line">
<p>Issued By</p>
:
<p><%=DepartmentName%></p>
</div>
</div>
<div class="right">
<div class="line">
<p>Gate Pass Date</p>
:
<p><%=GatePassDate%></p>
</div>
<div class="line">
<p>Issued To</p>
:
<p><%=PartyName%></p>
</div>
</div>
</div>
<table>
<tr>
<th>Item Name</th>
<th>Unit</th>
<th>Out</th>
<% if (GatePassType === "RGP") { %>
<th>Exp Ret. Date</th>
<% } %>
<th>Purpose</th>
</tr>
<% for(let i = 0; i < Items.length; i++) { %>
<tr>
<td><%= Items[i].ItemCode Items[i].ItemName %></td>
<td><%= Items[i].Unit %></td>
<td><%= Items[i].Quantity%></td>
<% if (GatePassType === "RGP") { %>
<td><%=Items[i].ReturnDate%></td>
<% } %
<td><%= Items[i].Remarks %></td>
</tr>
<% } %>
</table>
<footer>
<p>
N.B.: Carrier to be produce his copy at security office while
returning the material to the factory.
</p>
<div class="two">
<p><%=InitiatorEName%></p>
<p><b>Initiated By</b></p>
<br />
<p><%=ApproverEName%></p>
<p><b>Authorized By</b></p>
</div>
<div class="two">
<p><%=CarrierString%></p>
<p><b>Carrier Name</b></p>
<br />
<p><%=MainGateEname%></p>
<p><b>Security By</b></p>
</div>
</footer>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为发布屏幕截图最容易。

您缺少关闭标签 - &gt;
I think that it would be easiest to post a screen shot.

You are missing closing tag ->
您在此部分缺少
&gt;
:You are missing a
>
in this part: