誰かがmailtoリンクをクリックすると別のページも表示されるリンクを希望します。リンクを別のページに移動してメールにもメールする方法を教えてください。
htmlの外観はどうですか?現在:
<a href="mailto:[email protected]">email</a>
リンクのクリックイベントに
誰かがmailtoリンクをクリックすると別のページも表示されるリンクを希望します。リンクを別のページに移動してメールにもメールする方法を教えてください。
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が必要になることがあります。ありがとう。 –