webmaster256
asked on
Cold Fusion and Javascript arrays
I have a rotating ad banner system that randomizes the ID for each refresh of the page... It takes a range of numbers, and selects a random number, between 1 and the maximum recordcount. The only problem is that if records are deleted, it includes that ID in the range.
How can I randomize within a set number of EXISTING records?
EG:
ID
1
2
3
4
5
6
7
9
25
33
What will happen, is that it will randomize between 1 and 33... Eventually, it will try to display the banner with the ID of 10... However there is no banner there with that ID... How can I avoid this?
How can I randomize within a set number of EXISTING records?
EG:
ID
1
2
3
4
5
6
7
9
25
33
What will happen, is that it will randomize between 1 and 33... Eventually, it will try to display the banner with the ID of 10... However there is no banner there with that ID... How can I avoid this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
or just get the CF_RGrabber custom tag and use..
ASKER
Thank you very much!!! Sorry it took so long for me to get back to you on this...