FANDOM


<<<< Back To T-Codes

Adding buttons that change everytime you refresh the site will make a huge impact on making image-based ads or image-based buttons that change whenever you hit the refresh button. The code has been provided below in JavaScript Code.

<style type="text/css"> </STYLE><script LANGUAGE="JavaScript"> <!-- Begin var how_many_ads = 3; var now = new Date() var sec = now.getSeconds() var ad = sec % how_many_ads; ad +=1; if (ad==1) { url="WEBSITEURL"; alt="Alt Text"; banner="BUTTONURL"; width="88"; height="34"; } if (ad==2) { url="WEBSITEURL"; alt="Alt Text"; banner="BUTTONURL"; width="88"; height="34"; } if (ad==3) { url="WEBSITEURL"; alt="Alt Text"; banner="BUTTONURL"; width="88"; height="34"; } if (ad==4) { url="WEBSITEURL"; alt="Alt Text"; banner="BUTTONURL"; width="88"; height="34"; } document.write('<a href=\"' + url + '\" target=\"_blank\">'); document.write('<img src=\"' + banner + '\" width=') document.write(width + ' height=' + height + ' '); document.write('alt=\"' + alt + '\" border=0></a>'); // End --> </SCRIPT>