[英]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 %>
I've checked through and tested a bunch of different tags for ejs just in-case but I do not see why this is not working.我已经检查并测试了 ejs 的一堆不同标签,以防万一,但我不明白为什么这不起作用。 It worked previously but there must be some issue I'm overlooking unless it is the fault of ejs?
它以前有效,但除非是 ejs 的错,否则我必须忽略一些问题?
I think the problem is with the ejs tags.我认为问题出在 ejs 标签上。
You have wrote: <% include templates/file.ejs %>
您写道:
<% include templates/file.ejs %>
And should be: <%- include ("templates/file.ejs") %>
并且应该是:
<%- include ("templates/file.ejs") %>
At least I had same problem and solved that way, I hope is usefull.至少我遇到了同样的问题并以这种方式解决了,我希望有用。 look for more info about ejs changes: https://github.com/RyanZim/EJS-Lint
查找有关 ejs 更改的更多信息: https : //github.com/RyanZim/EJS-Lint
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.