[英]Include paramerised URL in email body of a mailto link
I have a Javascript variable fullurl
which is a url of the form http://example.com/page.php?id=123
我想在正文中創建一個帶有此 URL 的 mailto 鏈接
html += '<a href="mailto:&subject=Test&body=' + fullurl +'">Click here</a> to email this link';
結果是一個 email 的主體只是http://example.com/page.php
所以我想它是? 在 URL 中將其丟棄,因為它將其解釋為 body 的結尾 = mailto 的一部分
您可以嘗試使用 encodeURIComponent。
fullurl = encodeURIComponent("http://example.com/page.php?id=123")
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.