最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

EJS错误:SyntaxError:缺少),参数列表中的参数后

网站源码admin28浏览0评论

EJS错误:SyntaxError:缺少),参数列表中的参数后

EJS错误:SyntaxError:缺少),参数列表中的参数后

我目前正在尝试使我的代码与ejs一起使用,但仍然存在synthax错误。我尝试了很多不同的方法,但是我不确定什么地方出错了。你能帮我吗?

代码:

enter <div class="row multi-columns-row">
<% if (products) { %>
    <div class="price-table font-alt">
        <ul style="list-style-type:none">

                <% for(var i=0 ; i<products.length ; i++) { %>
            <li>
                <div class="col-sm-4">
                    <strong><%= this.item.name %></strong><br/>
                </div>
                <div class="col-sm-4">
                    <span><%= this.quantity %></span>
                    </br>
                    <%= this.prix %> Euros
                    <a href="/removeBasket/<%= this.item.id %>" class="btn btn-b btn-sm"></i> Remove </a>
                </div>

            </li>
                <div class="borderline">
                </div>
                <% } %>
        </ul>
    </div>
    <div class="col-sm-12">
        <strong>Total: <%= totalPrice %> Euros</strong>
    <hr>
        <a href="#" type="button" class="btn btn-b btn-circle btn-sm">Checkout</a>
    </div>
    <% } else { %>
    Your shopping cart is empty.
    <% } %>

感谢您的帮助。

托马斯

回答如下:

不幸的是,该错误没有涉及到特定的行。完整的错误如下:

SyntaxError:缺少)C:\ Users \ thoma \ Desktop \ NodeJS Mysql Express MVC \ views \ cart.ejs中的参数列表在编译ejs时

如果以上错误没有帮助,您可以尝试使用EJS-Lint:https://github/RyanZim/EJS-Lint或者,如果您打算创建一个异步函数,则将async: true作为选项传递。在新功能()在Templatepile(C:\ Users \ thoma \ Desktop \ NodeJS Mysql Express MVC \ node_modules \ ejs \ lib \ ejs.js:626:12)在Objectpile(C:\ Users \ thoma \ Desktop \ NodeJS Mysql Express MVC \ node_modules \ ejs \ lib \ ejs.js:366:16)在handleCache(C:\ Users \ thoma \ Desktop \ NodeJS Mysql Express MVC \ node_modules \ ejs \ lib \ ejs.js:215:18)在tryHandleCache(C:\ Users \ thoma \ Desktop \ NodeJS Mysql Express MVC \ node_modules \ ejs \ lib \ ejs.js:254:16)在View.exports.renderFile中[作为引擎](C:\ Users \ thoma \ Desktop \ NodeJS Mysql Express MVC \ node_modules \ ejs \ lib \ ejs.js:459:10)在View.render(C:\ Users \ thoma \ Desktop \ NodeJS Mysql Express MVC \ node_modules \ express \ lib \ view.js:135:8)在tryRender(C:\ Users \ thoma \ Desktop \ NodeJS Mysql Express MVC \ node_modules \ express \ lib \ application.js:640:10)在Function.render(C:\ Users \ thoma \ Desktop \ NodeJS Mysql Express MVC \ node_modules \ express \ lib \ application.js:592:3)在ServerResponse.render(C:\ Users \ thoma \ Desktop \ NodeJS Mysql Express MVC \ node_modules \ express \ lib \ response.js:1012:7)

发布评论

评论列表(0)

  1. 暂无评论