We blog on many topics around Typo3 and Java / J2EE

In order to realize a spam protection for e-mail addresses, the mailto link in the HTML page can be masked with "(at)" for "@" and "(dot)" for "." When loading the page the "(at)" and "(dot)" will be replaces by the corresponding "@" symbol and "." .

HTML

<body>
  <footer>
    <div>
      <a href="mailto:you(at)youremailaddress(dot)com">you(at)youremailaddress(dot)com</a>
    </div>
  </footer>
</body>

JQuery

$(document).ready(function() {
   $('a[href^="mailto:"]').each(function() {
        this.href = this.href.replace('(at)', '@').replace(/\(dot\)/g, '.');
        // Remove this line if you don't want to set the email address as link text:
        this.innerHTML = this.href.replace('mailto:', '');
    });
}

Archive

2016 (5)

May (4)

January (1)

2015 (2)

November (1)

May (1)

2014 (1)

April (1)

2012 (3)

May (3)