为什么会出现此错误?
<ul>
<%for(i=0;i<=todolist.length;i++){%>
<li><%=todolist[i].name%></li>
<% }%>
</ul>
答案 0 :(得分:0)
这看起来像EJS。也许从服务器尝试如下操作:
var template_file_path = "???";
require ("ejs").renderFile (template_file_path, {
todolist: [{
name: "A"
},{
name: "B"
}]
}, {}, function (err, strand) {
if (err) {
res.statusCode = 500;
res.end ();
return;
}
res.statusCode = 200;
res.write (strand);
res.end ();
});
如果不是EJS ..那我就不知道了。