我从 API 获得了一个 ID 列表,需要将其添加到 EJS 模板内的 URL 中,以便我可以获取正确的项目。示例网址:http : //url.com/get/ : id示例 ID:526 876 929EJS 模板中需要的结果:<li> http://url.com/get/526 </li><li> http://url.com/get/876 </li><li> http://url.com/get/929 </li>我根据需要获得了 ID 列表,但我不明白为什么我的 forEach 循环不会返回 URL+ID。这是消息的 console.log:[ 526, 876, 929 ]这是 EJS 文件:<% var itemurl = "http://url.com/get/" %><% message.forEach(itemView) => { %> <%= item url + itemView %><% }); %> 我不断收到语法错误,显然我错过了一些东西。
添加回答
举报
0/150
提交
取消