【问题标题】:HandlebarsJS: Hyperlink containing placeholder?HandlebarsJS:包含占位符的超链接?
【发布时间】:2020-01-29 11:35:01
【问题描述】:

我有下表,其中的超链接当前不起作用:

<div class="table">
    <table id="personTable">
        <tbody>
            <tr>
                <th>Id</th>
                <th>Name</th>
            </tr>
            {{#each person}}
            <tr>
                <td><a href="https://www.mywebsite/person/{{id}}">{{id}}</a></td>
                <td>{{name}}</td>
            </tr>
            {{/each}}
        </tbody>
    </table>
</div>

如何将占位符添加到超链接的末尾以便动态添加?

【问题讨论】:

  • 你能进一步解释你想要达到的目标吗?你的锚标签&lt;a&gt;没有正确生成?
  • 是链接本身不起作用,还是没有生成锚文本(即{{id}})?

标签: html json handlebars.js sendgrid


【解决方案1】:

解决方案:

试试单引号'

<a href='https://www.mywebsite/person/{{id}}'>{{id}}</a>

【讨论】:

    猜你喜欢
    • 2015-06-23
    • 1970-01-01
    • 1970-01-01
    • 2011-10-29
    • 1970-01-01
    • 2013-05-24
    • 2012-12-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多