|
Email Encryptor encrypts only the
actual email address, meaning you can customize the output any way you
want. The last line within the script is
where you can apply your own changes to the email link:
document.write('<a
href="mailto:'+postemail4digitnumber+'">Contact Us</a>')
Applying formatting to your email link is as simple as entering
the desired attributes into document.write() above. For example, to add an ID and style attribute to the link,
you would simply change the above line to:
document.write('<a
href="mailto:'+email_encrypt+'" id="email"
style="color: green">Contact Us</a>')
Sometimes you may not want to physically display the encrypted
email address on your page, but rather, manipulate it dynamically using
JavaScript. A common example is to populate a hidden field within a form using JavaScript
using the encrypted email variable, instead of directly entering your email
address (exposes it to spam harvesters). To do so, just generate your encrypted
email as usual, but by sure to select the "Output variable only" option
within the tool. This causes the script to only output a JavaScript variable
containing your encrypted email address, which you can then use within your form.
For example:
<!--Generated Email Encryptor code added above form
-->
<form>
<input type="hidden" id="email"
value="" />
</form>
<script type="text/javascript">
document.getElementById("email").value=email_encrypt
</script>
As you can see, we use the generated variable "email_encrypt"
from Email Encryptor instead of your exposed email address to populate the hidden
field. This is just one
example of using the encrypted email address dynamically, by outputting it as a
JavaScript variable.
|