Javascript 编译ejs时中参数列表后的SyntaxError:缺少)
编译ejs时,在参数列表之后出现错误:缺少)。 我试了很多次,但都没找到问题 下面是导致错误的EJ。 这个代码有什么问题Javascript 编译ejs时中参数列表后的SyntaxError:缺少),javascript,syntax-error,ejs,Javascript,Syntax Error,Ejs,编译ejs时,在参数列表之后出现错误:缺少)。 我试了很多次,但都没找到问题 下面是导致错误的EJ。 这个代码有什么问题 <%- include('../_layouts/adminheader') %> <h2 class='page-title'>Products</h2> <br> <a href="/admin/products/add-product" class="btn btn-primary">Add a new pr
<%- include('../_layouts/adminheader') %>
<h2 class='page-title'>Products</h2>
<br>
<a href="/admin/products/add-product" class="btn btn-primary">Add a new product</a>
<br><br>
<% if (count > 0) { %>
<table class="table table-striped">
<thead>
<tr class="home">
<th>Product</th>
<th>Price</th>
<th>Category</th>
<th>Product Image</th>
<th>Edit</th>
<th>Delete</th>
</tr>
</thead>
<tbody>
<% products.forEach(function(product) { %>
<tr>
<td><%= product.title %></td>
<td>$<%= parseFloat(product.price).toFixed(2) %></td>
<td><%= product.category %></td>
<td>
<% if (product.image == "") { %>
<img src="/images/noimage.png">
<% } else { %>
<img src="product_images/<%= product._id %>/<%= product.image %>">
<% }%>
</td>
<td><a href="/admin/products/edit-product/<%= product._id %>">Edit</a></td>
<td><a href="/admin/products/delete-product/<%= product._id %>" onclick="return confirm('Are you sure you want to delete this item?');">Delete</a></td>
<% } %>
</tr>
<% }); %>
</tbody>>
</table>>
<% } else { %>
<h3 class="text-center">There are no products.</h3>>
<% } %>
<%- include('../_layouts/adminfooter') %>
产品
0) { %>
产品
价格
类别
产品形象
编辑
删除
$
/">
>
>
没有产品。>
在结束前,
行
<% } %>