What I want is to display one of, let's say, 10 different pieces of content (like an image or link or text or whatever) randomly when someone views the page.
I found this but it isn't working. I am on Wordpress and am using Code Insert Manager to use specific code on an individual page.
<SCRIPT LANGUAGE="JAVASCRIPT">
var r_text = new Array ();
r_text[0] = "I was just thinking about you!";
r_text[1] = "You are a great example for others.";
r_text[2] = "You have great ideas.";
r_text[3] = "When I grow up I want to be you!";
r_text[4] = "I appreciate all of your opinions.";
var i = Math.floor(r_text.length * Math.random());
document.write("<br /><br /><br /><br /><br /><br /><br /><center><FONT SIZE=72><FONT COLOR='#FFFFFF'>" +
r_text[i] + "</FONT></center><br />");
var bgcolorlist=new Array("#228B22", "#FFD700", "#ADFF2F", "#FF69B4", "#CD5C5C", "#4B0082", "#7CFC00", "#ADD8E6", "#E84643", "#ED0A07", "#EA2907", "#E5294B", "#E00D26", "#FF3030", "#FC7500", "#F95700", "#F43900", "#F95620")
document.body.style.background=bgcolorlist[Math.floor(Math.random()*bgcolorli st.length)];
</script>
But nothing is showing up on the page. I am completely unfamiliar with this kind of coding and could use some serious help modifying this so it works. I can fill in the content just fine, just need it to display first.
tag, other HTML can be anywhere in de body.
– Sjors Jan 20 '15 at 05:27