Adding Email Links

Email links and hide email script

Pinned Note Adding Links
You can use any plain text editor like Notepad or TextEdit on Mac to add links into the body of your webpages or into a .js external Javascript file.

See Also…

Standard email link
This is the standard link for adding an e-mail to an HTML page. This type of email link may be harvested by spammers. See "hidden e-mail link" below.




Hidden email link option #1
The following email link code uses Javascript so your e-mail is not seen on the page by search engines or email harvesters and you'll get less spam. Code for HTML pages:



This is how the above will appear on your webpage:

Contact Us

Use the following if you want to add this code to a .js file:




Hidden email link option #2
Or you can optionally use the following code in an HTML page. This code does not work in jQuery includes.



Note: To add the above code to a .js file you can remove the first 2 and last 2 lines of code. These are the script start and end lines.

Note: For an image link in the above code, replace this line:

document.write(emailname+'@'+emailserver+'.com');

With the following:

document.write('<img src="picts/email.jpg" style="border: 0px;" alt="Contact Us">');


Hiding the email used in a form
See adding page links for code and details.


Email link in a .js file
Add the standard email link with document write code added. You can use the following code in any .js file.




Image email link
This is the standard link for adding an e-mail image link to an HTML page. This type of email link may be harvested by spammers. Place an image named "email.jpg" in your template picts folder. Also see "hidden email link" above.





Troubleshooting: Links not working
If you have added links and they do not seem to work when testing, see the links not working support page.




Related Topics:
New Window Target Links
Links Not Working After an Edit
Editing the Menus




Mobile and Responsive Web Design Website Layouts