Set a mailto link with a subject containing an ampersand (amp;)(设置包含与号 (amp;) 的主题的 mailto 链接)
问题描述
我正在使用以下 mailto
链接发送电子邮件:
<a class="share3" title="IiBocmVmPQ=="mailto:?subject=@check&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="IiBocmVmPQ=="mailto:?subject=@check&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
这篇关于设置包含与号 (&) 的主题的 mailto 链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:设置包含与号 (&) 的主题的 mailto 链接


- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
- 400或500级别的HTTP响应 2022-01-01
- Fetch API 如何获取响应体? 2022-01-01
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01
- addEventListener 在 IE 11 中不起作用 2022-01-01
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
- Flexslider 箭头未正确显示 2022-01-01
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
- 失败的 Canvas 360 jquery 插件 2022-01-01
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07