使用快速渲染方法将数据渲染到html文件

时间:2018-10-13 10:06:14

标签: javascript node.js express

我想将有关身份验证状态的数据呈现到位于index.html的登录表单中: 我试图这样做

companies <- c("IOC.BO", "BPCL.BO", "ONGC.BO", "HINDPETRO.BO", "GAIL.BO")
Stocks <- vector("list", length(companies))

for(i in seq_along(companies)){
  Stocks[[i]] <- getSymbols(name, auto.assign = FALSE)
}
Stocks

但是它不起作用;需要帮助

这是我的项目树:

enter image description here

还有我的server.js文件:

response.render(__dirname + "/CERIGame/index.html", { 
    errors: "authentication failed" 
});

我想在我的index.html中显示错误变量内容

 app.get('/login', function(request, response) {

    var username = request.query['username'];
    var password = request.query['password'];

    if (username == "" || password == "") {
        response.render(__dirname + "/CERIGame/index.html", { errors: "authentication failed" });
    }
});

0 个答案:

没有答案