Random Appearance

[Total: 0    Average: 0/5]

This shows how to easily have content that is randomly placed onto the page each time the page is reloaded. This example happens to reload this page when you click any of the four links it creates, just to show you on the reload that the content is in f

Body Code:

<script type=text/javascript>
var d=document;
var v1="one";
var v2="two";
var i1=v1;
var i2=v2;
if ((Math.random()*10)%2 < 1) { i1=v2; i2=v1; }
function rl() { document.location=document.location }
d.write('<a href=javascript:rl()>'+i1+'</a>');
d.write('<a href=javascript:rl()>'+i2+'</a>');
d.write('<HR size=4 align=left width=100>');
var v3="three";
var v4="four";
var j1=v3;
var j2=v4;
if ((Math.random()*10)%2 < 1) { j1=v4; j2=v3; }
d.write('<a href=javascript:rl()>'+j1+'</a>');
d.write('<a href=javascript:rl()>'+j2+'</a>');

Times Viewed: 1

Leave a Reply

Your email address will not be published. Required fields are marked *