簡體   English   中英

語法錯誤:編譯 ejs 時 index.ejs 中出現意外標識符

[英]SyntaxError: Unexpected identifier in index.ejs while compiling ejs

<body>
        <header>
            <% include templates/header.ejs %>
        </header>
            <% include templates/announcement.ejs %>
        <form>
            <br><input type="text" id="myInput" onkeyup="myFunction()" placeholder="Search a fort...">
        </form><br>
        <section id="placeList">
            <div class="placeListBackground" id="placeListGet">
             <ul id="placeCells">
                <% placeData.forEach(function(placeData) { %>
                    <div class="placeContainer <%= placeData.category %>" class><a href = "https://www.roblox.com/games/<%= placeData.placeid %>/-"><img src= "<%= placeData.placeicon %>" alt="<%= placeData.placename %>" align="left" width="178" height="100"><span><%= placeData.placename %></span><p><%= placeData.clan %></p><p>Playing: <%= placeData.playing %></p><p class="sCategory"><%= placeData.category %></p></a></div>
                <% }); %>
             </ul>
            </div>
        </section>
        <br><footer>Contact us: https://discord.gg/fMb5y7T</footer>
    </body>
    <% include templates/search.ejs %>

我已經檢查並測試了 ejs 的一堆不同標簽,以防萬一,但我不明白為什么這不起作用。 它以前有效,但除非是 ejs 的錯,否則我必須忽略一些問題?

我認為問題出在 ejs 標簽上。

您寫道: <% include templates/file.ejs %>

並且應該是: <%- include ("templates/file.ejs") %>

至少我遇到了同樣的問題並以這種方式解決了,我希望有用。 查找有關 ejs 更改的更多信息: https : //github.com/RyanZim/EJS-Lint

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM