Encode/decode Email Addresses And Phone Numbers - spamGuard

Encode/decode Email Addresses And Phone Numbers - spamGuard

The spam guard jQuery plugin lets you encode/decode email addresses and phone numbers to prevent spambots from harvesting email addresses and phone numbers on your website.

Email/Phone Number Encoder/Decoder

See also:

How to use it:

1. Include jQuery library and the jQuery spamGuard plugin on the webpage.

<script src="https://code.jquery.com/jquery-1.12.4.min.js" 
        integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" 
        crossorigin="anonymous"></script>
<script src="dist/jquery.spamguard.js"></script>

2. Insert the encoded email addresses and phone numbers into the webpage.

<a href="#" class="emailDemo">adSYmi[nK§\@VjqSu#EeWXrMHy*€scZrQi~'p€t-H\.Dnet]E'</a>
<a href="#" class="phoneDemo">\+1 YC(W2#0M'2U)´ 123|$\-N*4|5X6V7</a>

3. Call the plugin to decode the email addresses and phone numbers.

$(".emailDemo").spamguard();
$(".phoneDemo").spamguard({ protect: "telephone" });
<!-- Output -->
<a href="mailto:[email protected]" class="emailDemo"><!--noindex--><!--googleoff: all-->[email protected]<!--googleon: all--><!--/noindex--></a>
<a href="tel:+12021234567" class="phoneDemo"><!--noindex--><!--googleoff: all-->+1 (202) 123-4567<!--googleon: all--><!--/noindex--></a>

4. Customize the content to replace the decoded the email addresses and phone numbers.

$(".emailDemo").spamguard({
  content: 'Custom Content Here'
});

5. Determin whether or not to prepend <!--noindex--><!--googleoff: all-->.

$(".emailDemo").spamguard({
  noindex: true
});

This awesome jQuery plugin is developed by philippgithub. For more Advanced Usages, please check the demo page or visit the official website.

  • Publication date: 07.11.2018
  • Source