Optimising random display script

sk1media

New Member
Hey all,

Im a little new to Javascript so require some basic help.

I have a small script for displaying a random image and link in a small ad window on my site.

i want to re-use the code over and over on multiple pages and easily add new random items to add.

At the moment I am re-using the script, embedded in the HTML, over and over.

Any tips / suggestions on how to have just a single script file and recall its function throughout the site.


I know this is basic stuff, so apologies - Its just stumping me a little.


Here is the pre-release page, im looking at the ad's on the page.

http://www.iloverossonwye.com/iloverossonwye_v2/ross_v2_index.html


:eek:)

Thanks for your help !!
 

bcee

New Member
If you include the script in PHP you will only have to edit one file, but that isn't very optimal.

For the best option go with a script that loads the image/url data from JSON or XML so you only have to edit those files instead of the JS on every page.
 

sk1media

New Member
can you suggest any pre-made ones??

Im not too good with javascript, I have seen a few codes around but nothing that fits the bill 100%.

Thanks
 
Top