Copyright 1998 Lawrence Goetz
This is a free script that will allow you to have random ads appear on your site. All that is required by your visitors is a browser that supports JavaScript, such as Netscape, IE, or AOL.
The script displays a random banner ad when the visitor goes to your page. If you have frames on your site, you can have a banner frame automatically displaying a random ad.
There are 4 arrays, each for a different aspect of the link. The arrays
are:
image - The gif or jpg image of the ad.
link - The link for the ad.
info - The info of the ad. Used for the ALT image tag and displayed when
the mouse is moved over the ad.
target - Used in frames to display the ad. Default is _self.
Target commands:
_top will display the site in the main window of the browser (as if
there were no frames).
_blank will display the site in a new browser window.
_self will display the site in the frame that the applet is in.
name will display the site in the frame specified by name.
You also need to set the number of ads defined in a variable called amount. Failing to do so, or giving this a value that does not match the amount of ads will lead to an error.
An example of an ad
is:
image[0]="ltoys.jpg";
link[0]="http://filepile.com/nc/dd?ltoys.zip+mswin";
info[0]="Larrys Toys";
target[0]="website";
For the values you can not use ' or " you will get script errors.
Fill in the information after the line:
// Place your banner information here. Start at index number 0.
Here is a sample set of ads:
Sample Ads
You can also have the ads rotate in a frame by using the refresh meta tag:
<META HTTP-EQUIV=REFRESH CONTENT="time; URL=address">
Replace time with the number of seconds to pause before changing the ad.
Make this size large enought for the ad to download before changing.
Replace address with the name of the html file that this meta tag is in,
so it will reload. Basically it needs to reload itself.
Here is an example of that:
Sample Rotating Ads
Add this code in the BODY tag of your page. This is
where the ads will be displayed.