pbolduc 0 Report post Posted December 27, 2004 As I was working on a sub domain for my new site I decided to protect the email addresses on the site with a simple javascript to prevent harveters from grabbing them and flooding the mail box with spam. Hadn't seen the script in the forum yet so I thought I'd share it. Change the information in blue to yours and place this code where you want the link to show. Left as is no line decloration will appear under the link. If you want the link underlined then change none to: underline <script language="JavaScript"><!-- username = "usernameHere"; siteURL = "siteURLHere"; document.write('<a href=\"mailto:' + username + '@' + siteURL + '\"style="text-decoration: none;"> Contact Us</a>'); // End --> </script> Share this post Link to post Share on other sites
jipman 0 Report post Posted December 28, 2004 It might be a little better if you convert ESCAPE that javascript or to convert every character to a char(...) / chr (...) value. Share this post Link to post Share on other sites
pbolduc 0 Report post Posted December 28, 2004 It might be a little better if you convert ESCAPE that javascript or to convert every character to a char(...) / chr (...) value. <{POST_SNAPBACK}> Please explain more clearly... thanks Share this post Link to post Share on other sites
coder2000 0 Report post Posted December 28, 2004 I think he means encode each into a chr value rather than straight text. Share this post Link to post Share on other sites
pbolduc 0 Report post Posted December 28, 2004 I think he means encode each into a chr value rather than straight text. <{POST_SNAPBACK}> Perhaps this is what he was saying? <script language="JavaScript"><!-- purpose = "mailto:"; username = "usernameHere"; siteURL = "siteURLHere"; linkName = "Contact Us"; document.write('<a href=\"'+purpose+username+'@' + siteURL + '\"style="text-decoration: none;"> '+linkName+'</a>'); // End --> </script> This script works the same and I guess it would be a little bit more secure pete Share this post Link to post Share on other sites