PDA

View Full Version : Javascript gurus please help.


megatron
23-02-2005, 17:15
If you look in my code on this page:

http://www.minipockycinema.com/calendar/

you'll see that I'm using javascript to generate a random banner everytime the page is reloaded.

Is it possible to modify the code so that I can add the appropriate affiliate link to each banner?

*Please try to ignore the messy DW generated code. :nuts:

R2-D2
23-02-2005, 17:25
Yes, add the appropriate affiliate link HTML to the image HTML. (That is, wrap the "IMG" tag with an "A HREF=..." tag.)

megatron
23-02-2005, 17:45
Can you provide an example as I'm sure I've tried what you are describing to no avail.

R2-D2
23-02-2005, 19:01
For example, change this line:
image[number++] = "<img src='http://minipockycinema.com/associates/yesasia1/casshern_banner.jpg' border='0'>"
to:
image[number++] = "<a href='http://my.affiliate.link/'><img src='http://minipockycinema.com/associates/yesasia1/casshern_banner.jpg' border='0'></a>"

megatron
23-02-2005, 20:26
Thanks mate. Seems to have done the job. Must have missed a quotation mark or something before. :thumbs: