【发布时间】:2020-08-28 04:29:50
【问题描述】:
sort.ejs 文件代码
<html>
<form action="/" method="post">
<button type="submit" name="bubble" value="bubble">Bubble Sort</button>
</form>
<hr id = "123" style="height:<%=hgt%>px;border-left: <%=width%>px solid black;float: left;margin-left:<%=margin%>px">
</html>
app.js 文件代码
app.get("/", function(req, res) {
res.render("sort",{array:array,size:200,flag1:0,flag2:0,flag3:0,flag4:0});
});
app.post("/",function(req,res){
}
当发布请求被触发时,我想在终端的 sort.ejs 文件中打印 hr 标签的样式元素(高度、边距)的值。 sort.ejs 中使用的所有变量都是预定义的。
我正在使用 Node.js 和 EJS。
【问题讨论】:
标签: javascript html node.js ejs