Hi there,
I have this script that I need some direction in; it's mangled my head
a bit.
I want to be able to stick links around six random words; these links
are then popup ads.
I saw kind of a similar thing on a site a while ago.
Basically, I have these 4 ads that I want to be able to turn on in a
random order, for example: The page loads and the first, third, fifth
and sixth predetermined words are active ad popups.
The problem I'm having is with the turning on randomly part.
If someone could please say whether I'm going in the right direction at
all for starters, and how I would check if the a number has already
come up in the loop.
Thank you ever so much, and happy christmas...
This is what I have so far:
function turn_ads_on() {
var add_01 = false;
var add_02 = false;
var add_03 = false;
var add_04 = false;
var add_05 = false;
var add_06 = false;
var which_ad = 0;
for (i=0; i<=3; i++1) {
which_ad = (Math.random() * 6) +1
which_ad = parseInt(which_ad, 10)
if (which_ad==1) {
add_01 == true;
/*something to dissallow 1 from comin up again*/
}
if (which_ad==2) {
add_02 == true;
/*something to dissallow 2 from comin up again*/
}
if (which_ad==3) {
add_03 == true;
/*something to dissallow 3 from comin up again*/
}
if (which_ad==4) {
add_04 == true;
/*something to dissallow 4 from comin up again*/
}
if (which_ad==5) {
add_05 == true;
/*something to dissallow 5 from comin up again*/
}
if (which_ad==6) {
add_06 == true;
/*something to dissallow 6 from comin up again*/
}
}