Hi there,

I'm setting up a "staff" page in a Drupal site that has the e-mail of the people. The old site (built in XHTML and CSS) uses a simple JavaScript to protect this e-mails from spam, just writting

               				<script language="JavaScript" type="text/javascript">
			   			<!--
						var string1 = "name";
						var string2 = "@";
						var string3 = "mydomain.com";
						var string4 = string1 + string2 + string3;
						var string5 = " class=normal";
						document.write("<a href=" + "mail" + "to:" + string1 +
						string2 + string3 + string5 + ">" + string4 + "</a>");
						//-->
                  				</script>

And this simple line in

<script language="JavaScript" type="text/javascript">

So I'm looking for the easiest way to write those e-mail address in Drupal preventing the spam. I have seen that it's possible to use this same system but you need to create a .js file and upload it somewhere, but I don't know where to upload it and what does that file need to content.

Can anyone explain that?
Is there an easiest way to do this in Drupal?

Thank you.

Comments

marquardt’s picture

Have a look at http://drupal.org/node/121997 (or go Documentation -> developing for Drupal -> JavaScript in Drupal).

You can also specify additional JavaScript file in the Theme's .info file (see http://drupal.org/node/171205#scripts), but the disadvantage is that your script will be loaded on every page.

dresde’s picture

Thanks for the reply, but I need something more "for dummies", that was too heavy for me :(

arh1’s picture

i recently discovered the spamspan module. can't vouch for it's effectiveness yet (ever?), but check it out and see what you think.