E-Mail-Spam-Protection
- 27. May 2016 - Typo3 at xandersIn 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:', ''); }); }