Click to See Complete Forum and Search --> : what if my banners are html files


apchar
01-16-2003, 02:41 AM
All the example scripts I've found for showing banner ads assume the ads are
image files. But what if my banner ads are HTML files, each with images
and even their own javascript code? How do I use javascript to pick
one html file at random and paste it at the top of my page and execute the
javascript within it? I'd like to avoid using frames if I can. If I have to use them
I will.
Thanx,
apchar

swon
01-16-2003, 08:57 AM
If they are files and your not using frames you cannot do it without using server side languages like PHP,Perl etc. are!

AdamGundry
01-16-2003, 02:51 PM
If you don't mind using IFrames (inline frames), you can use a tag of the form <iframe src="somepage.html"> (possibly generating the filename randomly).

Alternatively, you could include a script (with the tag <script src="somescript.js"></script>). This filename could again be randomly generated, and the script would perform a document.write() to insert the HTML code required.

Hope this helps as a starting point.

Adam