Pulls up a random page, it works but is there a better way?
Posted: Fri May 06, 2022 8:41 am
Pulls up a random page, it works but is there a better way?
http://www.MyAAGrapevines.com
http://www.MyAAGrapevines.com
Code: Select all
<script type="text/javascript">
<!--
// Create an array of the links to choose from:
var links = new Array();
links[0] = "index0.html";
links[1] = "index1.html";
links[2] = "index2.html";
links[3] = "index3.html";
links[4] = "index4.html";
links[5] = "index5.html";
links[6] = "index6.html";
links[7] = "index7.html";
links[8] = "index8.html";
links[9] = "index9.html";
links[10] = "index10.html";
links[11] = "index11.html";
links[12] = "index12.html";
links[13] = "index13.html";
links[14] = "index14.html";
links[15] = "index15.html";
links[16] = "index16.html";
links[17] = "index17.html";
links[18] = "index18.html";
links[19] = "index19.html";
links[20] = "index20.html";
links[21] = "index21.html";
links[22] = "index22.html";
links[23] = "index23.html";
links[24] = "index24.html";
links[25] = "index25.html";
links[26] = "index26.html";
links[27] = "index27.html";
links[28] = "index28.html";
links[29] = "index29.html";
links[30] = "index30.html";
links[31] = "index31.html";
function openLink() {
// Chooses a random link:
var i = Math.floor(Math.random() * links.length);
// Directs the browser to the chosen target:
parent.location = links[i];
return false;
}
//-->
</script>
Code: Select all
<body onload="openLink();">