我收到EJS错误说 - 找不到'%; lt;%;

发布于 2025-02-07 18:40:34 字数 3125 浏览 0 评论 0原文

我已经检查了有关嵌套标签等潜在原因的互联网。以前有,但我已经删除了它们。某些地方用户实际上忘记了关闭标签,但是我手动检查了每个标签,但是每个开头标签都有一个关闭标签。

有一些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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

人间不值得 2025-02-14 18:40:34

我认为发布屏幕截图最容易。
您缺少关闭标签 - &gt;

I think that it would be easiest to post a screen shot.
You are missing closing tag ->
enter image description here

旧情勿念 2025-02-14 18:40:34

您在此部分缺少&gt;

<% if (GatePassType === "RGP") { %>
    <td><%=Items[i].ReturnDate%></td>
<% } % <- HERE

You are missing a > in this part:

<% if (GatePassType === "RGP") { %>
    <td><%=Items[i].ReturnDate%></td>
<% } % <- HERE
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文