The above JS will select a URL link and image randomly from an array in the code. In my case I use it simply to select from an internal banner ad system and an external one. The rand variable is a randomiser for the ad systems and is not required for simple banner ad rotation.
I call the JS from a template but keep the JS in a server file so that it can be easily changed.
|