【发布时间】:2017-11-25 04:08:26
【问题描述】:
我正在开发一个网站,该网站在通过联系表单 7 提交表单时会在网站上打开一个 href 链接。我有一个问题:它正在打开一个链接。但是我想在发送表单时同时打开两个链接。我不知道如何实现这一点。
请帮忙
document.addEventListener('wpcf7mailsent', function(event) {
location = document.getElementById("link").getAttribute("href");
}, false);
document.addEventListener('wpcf7mailsent', function(event) {
location = document.getElementById("link2").getAttribute("href");
}, false);
<a href="http://www.annualpm.com/wp-content/uploads/Fabius-GS-User-Manual.pdf" target="_blank" id="link">
<p><img style="height:40px;" src="http://www.annualpm.com/wp-content/uploads/Hopstarter-Software-Adobe-Acrobat-Standard.ico">Fabius GS User Manual</p>
</a>
<a href="http://www.annualpm.com/wp-content/uploads/FabiusGSSpecSheet.pdf" target="_blank" id="link2">
<p><img style="height:40px;" src="http://www.annualpm.com/wp-content/uploads/Hopstarter-Software-Adobe-Acrobat-Standard.ico">Fabius GS SpecSheet</p>
</a>
【问题讨论】:
标签: javascript jquery contact-form-7