我想要一個鏈接,如果有人點擊郵件鏈接,他們也會顯示不同的頁面。如何創建一個鏈接導航到另一個頁面,並郵寄到電子郵件?
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