spenoir
08-10-2006, 10:18 AM
Hi Everyone,
Its a glum morning here in london, think the summer is on its way out already, time to hibernate I guess. :)
Anyway, can anyone tell me whats wrong with the code below, i'm using the following code to output:
<script language="JavaScript">document.write('article[choice]'));</script>
var range = 6;
// Number of alternative nodes
var article = new Array(selectnode);
// Array to hold nodes
article[0] = "Content1";
article[1] = "Content2";
article[2] = "Content3";
article[3] = "Content4";
article[4] = "Content5";
article[5] = "Content6";
function pickRandom(range) {
if (Math.random) return Math.round(Math.random() * (range-1));
else { var now = new Date(); return (now.getTime() / 1000) % range; }
}
var choice = pickRandom(selectnode);
thanks in advance,
Its a glum morning here in london, think the summer is on its way out already, time to hibernate I guess. :)
Anyway, can anyone tell me whats wrong with the code below, i'm using the following code to output:
<script language="JavaScript">document.write('article[choice]'));</script>
var range = 6;
// Number of alternative nodes
var article = new Array(selectnode);
// Array to hold nodes
article[0] = "Content1";
article[1] = "Content2";
article[2] = "Content3";
article[3] = "Content4";
article[4] = "Content5";
article[5] = "Content6";
function pickRandom(range) {
if (Math.random) return Math.round(Math.random() * (range-1));
else { var now = new Date(); return (now.getTime() / 1000) % range; }
}
var choice = pickRandom(selectnode);
thanks in advance,