【问题标题】:mailto HTML e-mail link with dynamicly built subjectmailto HTML 电子邮件链接,带有动态构建的主题
【发布时间】:2014-12-27 14:11:29
【问题描述】:

您好,需要动态构建主题。 IE。我有一些我想添加到主题的数据的输入。

例如,如果我只是构建 html,我可以编写以下内容:

<span style="color: #434343; font-family: 'Segoe UI REGULAR'; font-size: 12pt;">
   <text id="supportDescription">Id is '[context.eventId]' .</text>
 </span>

打开 html 时,我会看到 Id is 345345 是一个参数) 我不想在 html 中添加id,而是想添加一个mailto 链接,包括id

<a href="mailto:name@gmail.com?subject=The%20 reply for evetId '[context.eventId]'">Send mail </a>

变电站也在这里工作吗?主题为The reply for evetId 345

【问题讨论】:

  • 你为什么不试试呢?

标签: javascript jquery html email


【解决方案1】:

当输入值改变时,您可以使用 jQuery 事件处理程序将输入中输入的任何文本放入链接中。 DEMO

$('input#eventid'). on('change', function() {
    var link = "mailto:name@gmail.com?subject=The%20reply%20for%20evetId%20" + $(this). val();
    $('a#mailto').attr('href', link);
});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-02-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-25
    相关资源
    最近更新 更多