Created
August 2, 2013 19:39
-
-
Save dev1ne/6142800 to your computer and use it in GitHub Desktop.
Replace [AT] and [DOT] in mailto links in jQuery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /********************************* | |
| MAIL LINKS | |
| *********************************/ | |
| $('a[href^="mailto"]').each(function(){ | |
| var $link = $(this); | |
| var href = $link.attr('href'); | |
| var text = $link.text(); | |
| href=href.replace('[AT]','@'); | |
| href=href.replace('[DOT]','.'); | |
| text=text.replace('[AT]','@'); | |
| text=text.replace('[DOT]','.'); | |
| $link.attr('href',href); | |
| $link.text(text); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment