对于每个循环,用EJS模板
我试图执行以下代码行,并最终得到以下错误消息。是否有任何代码建议可以清除此问题?
<%= kindOfItems.forEach( function (item) { %>
<div class = "item">
<input type="checkbox">
<p>
<%= item.name %>
</p>
</div>
<%= }) %>
syntaxerror:d:\ web开发\ todolist \ todo-list ---- ejs-master \ todo-list --- ejs-aster \ ejs-master \ views \ views \ list.ejs
syntaxerror:意外令牌')' >
I tried to execute the below lines of code and ended up with the below error message. Any code suggestions to clear this out?
<%= kindOfItems.forEach( function (item) { %>
<div class = "item">
<input type="checkbox">
<p>
<%= item.name %>
</p>
</div>
<%= }) %>
SyntaxError: Unexpected token ')' in D:\web development\todoList\Todo-List---EJS-master\Todo-List---EJS-master\views\list.ejs while compiling ejs
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不熟悉EJ,而是通过它的外观,您缺少返回语句。快速Google之后,您似乎需要做以下操作
Not familiar with ejs but by the looks of it you are missing a return statement. After a quick google it seems you need to do the following