A simple email obfuscator/defuscator (jQuery based)
Version: 0.7
yab_email’s minimum requirements:
- Textpattern 4.x
- jQuery 1.3.x
Place this in your site to hide your email address from harvesters and bots.
email: a valid email address
Default: name@example.com
An email address, you want to be obfuscated.
class: class name
Default: yab-email-link
A class name for generated or element.
at: word between parenthesis
Default: at
A text string, that will be in parenthesis in obfuscated email.
link: boolean
Default: 1
Generate a link or show email as span element.
text: a link text
Default: not set
A text string, that will be the link text. Overwrite a link=“0”.
set_js: boolean
Default: 1
Generate Javascript for this very tag.
If you have more email addresses you want to be obfuscated or your jQuery inlcude is at the bottom of your site, you can place this tag after the jQuery include.
class: class name
Default: yab-email-link
A class name for generated or element. Has to be the same as in
link: boolean
Default: 1
Generate a link or show as span element.
Example with a jQuery inlcude in the head and only one address to obfuscate.
<!doctype html> <html> <head> <meta charset="utf-8" /> <title>Your tilte</title> <link rel="stylesheet" href="/path/to/your/stylesheet.css" /> <script src="/path/to/your/jQuery.js"></script> </head> <body>
<p><txp:yab_email email="contact@example.com" /></p>
</body> </html>
Example with a jQuery inlcude at the bottom and probably more address to obfuscate.
<!doctype html> <html> <head> <meta charset="utf-8" /> <title>Your tilte</title> <link rel="stylesheet" href="/path/to/your/stylesheet.css" /> </head> <body>
<p><txp:yab_email email="contact@example.com" set_js="0" /></p> <p><txp:yab_email email="ceo@example.com" set_js="0" /></p>
</body> <script src="/path/to/your/jQuery.js"></script> <txp:yab_email_javascript /> </html>
This plugin is released under the GNU General Public License Version 2 and above
- Version 2: http://www.gnu.org/licenses/gpl-2.0.html
- Version 3: http://www.gnu.org/licenses/gpl-3.0.html