【问题标题】:I want to print the data from the database into the element with ejs我想用 ejs 将数据库中的数据打印到元素中
【发布时间】:2021-03-15 15:00:36
【问题描述】:

this is my data on database

这是我的 posts.ejs 文件

<p>
    <%= data[i]['article'] %>
</p>

and this is output

如何在pre标签中写出来

【问题讨论】:

  • this 能回答你的问题吗?
  • @zhisme 是的。谢谢。我解决了

标签: javascript ejs


【解决方案1】:

使用这个

&lt;%- data[i]['article'] %&gt;

不是这个

&lt;%= data[i]['article'] %&gt;

更多关于here

【讨论】:

  • @AbdiKaan - 很棒
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-03-02
  • 1970-01-01
  • 2013-02-27
  • 2016-08-11
  • 2018-10-09
相关资源
最近更新 更多