我想要一个链接,如果有人点击邮件链接,他们也会显示不同的页面。如何创建一个链接导航到另一个页面,并邮寄到电子邮件?
html的样子是什么?当前:
<a href="mailto:[email protected]">email</a>
任何想法?
我想要一个链接,如果有人点击邮件链接,他们也会显示不同的页面。如何创建一个链接导航到另一个页面,并邮寄到电子邮件?
html的样子是什么?当前:
<a href="mailto:[email protected]">email</a>
任何想法?
使用JavaScript的链接的点击事件window.location的
<a href="mailto:[email protected]" onclick="window.location=another.html">email</a>
更新:
如果有堆积,大量的代码在onclick事件,创建一个函数,而不是
function handleClick() {
_gaq.push(['_trackEvent', 'emails', 'clicked', 'lead']); //first this
window.open = 'anotherpage.html'; //or window.location for redirection
}
HTML
<a onclick="handleClick()" href="mailto:[email protected]">email.com</a>
点击链接后,您可能需要JavaScript来重定向用户。 – 2012-03-31 21:49:40