I use a snippet of javascript (see below) every time I want to display my email address on my web site.This seems to eliminate spammers spidering the address.
Unfortunately, the script doesn't fit into the Milonic menus, even with the added flexibility of version 5.
Is there any way I can add this kind of parsing to the Milonic script?
<script language="Javascript">
a_mail_name = "heavener"
a_mail_domain = "heavenr.com"
document.write("<a href='mailto:" + a_mail_name + "@" + a_mail_domain + "'>");
document.write("<span style='color:Maroon;text-decoration:none;'>");
document.write(a_mail_name + "@" + a_mail_domain);
document.write("</span></a>");
</script>
The web site/menu is located at http://www.heavenr.com
Javascript email address
Hi,
What you need to do is put your code inside a function with a return value of your email address.
Here's the function:
This can go inside the menu_data.js file but the function needs to be included before you call it. So the best place to put this function is at the top of your data file.
To call this function, try this:
Hope this helps
Andy
What you need to do is put your code inside a function with a return value of your email address.
Here's the function:
Code: Select all
function myEmail()
{
a_mail_name = "heavener"
a_mail_domain = "heavenr.com"
retEmail="<a href='mailto:" + a_mail_name + "@" + a_mail_domain + "'>"
retEmail+="<span style='color:Maroon;text-decoration:none;'>"
retEmail+=a_mail_name + "@" + a_mail_domain
retEmail+="</span></a>"
return retEmail
}
To call this function, try this:
Code: Select all
aI("text="+myEmail()+";type=html;");
Andy
-
- Beginner
- Posts: 8
- Joined: Mon Aug 23, 2004 6:52 pm
- Location: Redmond, Washington USA
- Contact:
Your code snippet works great ... except the mouseover text color does not change. The URL is http://www.heavenr.com
If you remove the HTML for the span and let the menu control the colors, it will work as expected. You also need to remove the type=html; part
Here's another snippet.
then your aI() string should look like this:
If you have access to PHP you could also use the encoding function:
Cheers
Andy
Here's another snippet.
Code: Select all
function myEmail()
{
a_mail_name = "heavener"
a_mail_domain = "heavenr.com"
return a_mail_name+"@"+a_mail_domain
}
Code: Select all
aI("text="+myEmail()+";url=mailto:"+myEmail());
Code: Select all
function emailEnc($email)
{
$retEmail="";
for($a=0;$a<strlen($email);$a++)$retEmail.="&#".ord($email[$a]).";";
return $retEmail;
}
Andy