User:TheFearow/randomad.js

From Wikinews, the free news source you can write!
Jump to navigation Jump to search

Note: After saving, you may have to bypass your browser's cache to see the changes. Mozilla / Firefox / Safari: hold down Shift while clicking Reload, or press Ctrl-Shift-R (Cmd-Shift-R on Apple Mac); IE: hold Ctrl while clicking Refresh, or press Ctrl-F5; Konqueror: simply click the Reload button, or press F5; Opera users may need to completely clear their cache in Tools→Preferences. — More skins

importScript("User:TheFearow/ads.js");
function doAdOnload(){
 //document.getElementById("contentSub").innerHTML += "<div id='randomad' style='display: block;'></div>";
 randomad();
}
function randomad(){
 var ad = ads_text[Math.round(Math.random() * ads_text.length)];
 document.getElementById("siteSub").innerHTML = "From Wikinews: "+ad;
 setTimeout("randomad();", 10000);
}
addLoadEvent(doAdOnload);