Retired Bill
11-16-2006, 03:53 PM
I have exhausted my library of PHP and JAVASCRIPT books and can still not get my code to do what I need it to do. I am trying to hide an email link from spiders so that I will not be as vulnerable to spammers. The link is in a menu which is in table form. Can someone spot where I've gone wrong? This is the function I defined. It is in a document named mail.js:
function HideEmail()
{
var string1 = "foo";
var string2 = "@";
var string3 = "bar.biz";
var string4 = "Contact Us";
document.write("<a href=" + "mail" + "to:" + string1 +
string2 + string3 + ">" + string4 + "</a>");
}
I placed this command in the heading of the page. This one of two external js files used on my page:
<script src="mail.js" language="JavaScript" type="text/javascript"></script>
This is where I call the function in the document:
<php? print "<td width=\"20%\"><div align=\"center\" class=\"style1\"><script language=\"javascript\" type= \"text/javascript\">HideEmail();</script>"; ?>
This is what I see when I view the page in the browser:
"; ?>
function HideEmail()
{
var string1 = "foo";
var string2 = "@";
var string3 = "bar.biz";
var string4 = "Contact Us";
document.write("<a href=" + "mail" + "to:" + string1 +
string2 + string3 + ">" + string4 + "</a>");
}
I placed this command in the heading of the page. This one of two external js files used on my page:
<script src="mail.js" language="JavaScript" type="text/javascript"></script>
This is where I call the function in the document:
<php? print "<td width=\"20%\"><div align=\"center\" class=\"style1\"><script language=\"javascript\" type= \"text/javascript\">HideEmail();</script>"; ?>
This is what I see when I view the page in the browser:
"; ?>