如上所述,我需要创建一个将在 anchor 标记中使用的 class="donate"
,它将重定向并将 href
的值传递给我的另一个页面即 -mysite.com/donate.html,
donate.html 将能够获取该 href
值。
这样当用户点击“继续下载”时就可以下载
文件。
请告诉我是否可以。 我更喜欢仅 HTML 和 javascript。因为我不托管网页,所以我使用博客。
我在 templateism.com 上看到过类似的概念,例如:
www.templateism.com/p/preview.html?=www.templateism.com/10/2010/anypost.html
最佳答案
您可以使用以下链接:
mysite.com/donate.html?www.yoursite.com.otherpage.html
然后使用 JavaScript:
var href = document.location.href;
var link = href.split('?')[1];
关于javascript - 使用 html 和 javascript 将 href 值传递到另一个页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38244418/