PDA

View Full Version : Random Text Messages upon Reload


DJFutrell@aol.com
01-11-2001, 06:21 PM
Can someone please send me script that will, upon every loading of the page, display a different group of text. Thanks a lot. I will be using this on my page to show interesting quotes, so that everytime the page is accessed, a different quote is displayed.

DJFutrell@aol.com

kdjoergensen
01-11-2001, 06:37 PM
<script language="javascript">
<!--
myQuotes = new Array();
myQuotes[0]="quote 1";
myQuotes[1]="quote 2";
myQuotes[2]="quote 3";
myQuotes[3]="quote 4";
myQuotes[4]="quote 5";

var n = myQuotes.length-1;
var num = Math.round(n * Math.random());
quoteTxt = myQuotes[num];
//-->
</script>
..
..
</head>
<body>
..
..
<script language="javascript">
<!--
document.write(quoteTxt);
//-->
</script>

Ian
01-11-2001, 06:40 PM
Hi DJ, there are several scripts on A1 that should suit your needs. Random Quote: http://www.a1javascripts.com/miscellaneous/randomquote.html or you can configure the tip of the day to display a different quote each day. http://www.a1javascripts.com/miscellaneous/tipoftheday.html

good luck.

------------------
Ian

Web Development - BIG Resources Inc
Head Guide - 123Webmaster.com (http://www.123webmaster.com/)
ian@123webmaster.com
BIG Resources.com (http://www.bigresources.com)
ICQ: 25828668