pet*_*len 3 ejs node.js express connect-flash
我想在connect-flash消息的文本中包含一个链接:
JS
req.flash("registerMessage", "Sorry, the User ID you chose is already in use. Please choose another. If you have already registered and need assistance logging in, <a href=\"http://www.example.com/support/\">contact support</a>");
Run Code Online (Sandbox Code Playgroud)
EJS
<% if (message.length > 0) { %>
<div class="alert alert-danger"><%= message %></div>
<% } %>
Run Code Online (Sandbox Code Playgroud)
结果
<div class="alert alert-danger">Sorry, the User ID you chose is already in use. Please choose another. If you have already registered and need assistance logging in, <a href="http://www.example.com/support/">contact support</a>.</div>
Run Code Online (Sandbox Code Playgroud)
有没有办法阻止Flash转义HTML字符,以便我可以在我的消息中显示链接?
| 归档时间: |
|
| 查看次数: |
2834 次 |
| 最近记录: |