设置包含与号 (&) 的主题的 mailto 链接 [英] Set a mailto link with a subject containing an ampersand (&)

查看:25
本文介绍了设置包含与号 (&) 的主题的 mailto 链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用以下 mailto 链接发送电子邮件:

 <a class="share3" title="" href="mailto:?subject=@check&amp;body=@domain">

它运行良好,但有时我的主题会包含一个 & 字符,并且当它出现时,我的电子邮件创建时没有正文.

有什么办法可以解决这个问题?

解决方案

为了将特殊/保留字符放入 URL,您必须对它们进行编码 - 要使 & 工作,它必须编码为 %26.

更多详情:http://www.w3schools.com/tags/ref_urlencode.aspp>

Im using the following mailto link to send an email:

 <a class="share3" title="" href="mailto:?subject=@check&amp;body=@domain">

It works well, but sometimes my subject will contain an ampersand (&) character, and when it does my email is created without a body.

Any way to resolve this problem?

解决方案

In order to get special/reserved characters into a URL, you must encode them - to get an & to work, it must be encoded to %26.

More details here: http://www.w3schools.com/tags/ref_urlencode.asp

这篇关于设置包含与号 (&amp;) 的主题的 mailto 链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆