morrisdan1
05-19-2005, 12:07 PM
Hi there,
How are you doing ? :smile:
I'd like to use the following javascript banner rotator codes throughout my site:
script language="JavaScript">
<!-- Begin
rnd.today=new Date();
rnd.seed=rnd.today.getTime();
function rnd() {
rnd.seed = (rnd.seed*9301+49297) % 233280;
return rnd.seed/(233280.0);
};
function rand(number) {
var result = Math.ceil(rnd()*number);
if (!result)result++;
return result
};
var ad_cnt1 = 2;
var ad1 = rand(ad_cnt1);
var link1;
var adBanner1;
var width1
var height1
if (ad1==1) {
link1="http://www.dansbanners.com";
adBanner1="http://www.dansbanners.com/images/banners/dansbanners.gif";
width1="468";
height1="60";
alt1="";
}
if (ad1==2) {
link1="http://www.dansbanners.com";
adBanner1="http://www.dansbanners.com/images/banners/dbanners.gif";
width1="468";
height1="60";
alt1="";
}
document.write('<center><a href="' + link1 + '" target="_new">');
document.write('<img src="' + adBanner1 + '" width=' + width1 + ' height=' + height1 + ' border=0 alt="' + alt1 + '"></a>');
document.write('</center>');
// End -->
</SCRIPT>
The only thing is that rather than using the above codes in each html page in my site, I rather copy the above script into one javascript file. And have all html files in my site point to it. That I know how to do so.
However, the part I need help with is what codes should I write in the html files that would implement the above script, if you know what I'm asking in here ? :umm:
Thanks again in advance! :yeah:
How are you doing ? :smile:
I'd like to use the following javascript banner rotator codes throughout my site:
script language="JavaScript">
<!-- Begin
rnd.today=new Date();
rnd.seed=rnd.today.getTime();
function rnd() {
rnd.seed = (rnd.seed*9301+49297) % 233280;
return rnd.seed/(233280.0);
};
function rand(number) {
var result = Math.ceil(rnd()*number);
if (!result)result++;
return result
};
var ad_cnt1 = 2;
var ad1 = rand(ad_cnt1);
var link1;
var adBanner1;
var width1
var height1
if (ad1==1) {
link1="http://www.dansbanners.com";
adBanner1="http://www.dansbanners.com/images/banners/dansbanners.gif";
width1="468";
height1="60";
alt1="";
}
if (ad1==2) {
link1="http://www.dansbanners.com";
adBanner1="http://www.dansbanners.com/images/banners/dbanners.gif";
width1="468";
height1="60";
alt1="";
}
document.write('<center><a href="' + link1 + '" target="_new">');
document.write('<img src="' + adBanner1 + '" width=' + width1 + ' height=' + height1 + ' border=0 alt="' + alt1 + '"></a>');
document.write('</center>');
// End -->
</SCRIPT>
The only thing is that rather than using the above codes in each html page in my site, I rather copy the above script into one javascript file. And have all html files in my site point to it. That I know how to do so.
However, the part I need help with is what codes should I write in the html files that would implement the above script, if you know what I'm asking in here ? :umm:
Thanks again in advance! :yeah: