我的代码如下,当邮箱打开时,JS 代码片段会中断。
<a href="mailto:?subject=This is My Subject&body=Hithis is my text and my page url is"+window.location.href+\" click link to see Greater experienceto" target="_top" class="">
最佳答案
尝试这样:
<a href="#" onclick="javascript:window.location='mailto:?subject=Interesting information&body=I thought you might find this information interesting: ' + window.location + ' click link to see Greater experienceto'">Click</a>
关于javascript - 如何在 mailto 正文中附加 Javascript 代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45596873/