Java Code Samples
I do not claim to be an expert Java programmer, but I have collected a
number of Java scripts and use them in many of the web sites I design.
E-mail hiding script, foils spam harvesting robots|
Random Banner Rotator
E-mail Hiding Script
The term "e-mail harvesting robot" means a process where someone can visit
a web site or many websites looking for a "mailto:" tag that is used to
start an email anchor. It also looks for the famnilir @ sysmbol which is used
in email addresses. When these conditions are met, it graby your email
address and addes it to their spam list.
Here is a script designed which will hide your address
from the robots but still allows it to work in a visitors web browser.
var a='<a href=\"mai'
This script is used on our main page to rotate banners. This gives our site
a new look and feel each time someone visits out site.
banners = new Array()
banners="<IMG BORDER=0 SRC=images/banner01.JPG alt='Some title text'>"
banners="<IMG BORDER=0 SRC=images/banner02.JPG>"
banners="<IMG BORDER=0 SRC=images/banner03.JPG>"
banners="<IMG BORDER=0 SRC=images/banner04.JPG>"
banners="<IMG BORDER=0 SRC=images/banner05.JPG>"
banners="<IMG BORDER=0 SRC=images/banner06.JPG>"
banners="<IMG BORDER=0 SRC=images/banner07.JPG>"
var Number = Math.round(Math.random()*6);
var TheImage = banners[Number]
document.write("<CENTER>" +TheImage+ "</center>")
Notice the line that contains the Math statement. In our example we are rotating
7 banners as noted by the number 6. This number must always be the total number
of banners minus 1.
Back to Main Page