PDA

View Full Version : How can I get this to....


SDP2006
06-29-2003, 03:40 AM
How can I get this to display the quotes on a different day of the week (i.e. 0 being Sunday, 6 being Saturday) rather than on a browser refresh?

<html>
<head>
<script language="text/JavaScript">
<!--
var quotes = new Array(7)
quotes[0]="a quote here";
quotes[1]="a quote here";
quotes[2]="a quote here";
quotes[3]="a quote here";
quotes[4]="a quote here";
quotes[5]="a quote here";
quotes[6]="a quote here";
var rand_int= Math.floor(Math.random()*7);
//-->
</script>
</head>
<body>
<script language="text/javascript">
<!--
document.write(quotes[rand_int]);
//-->
</script>
</body>
</html>


Thanks:thumbsup:

realisis
06-29-2003, 06:40 AM
<body>
<script>
<!--
var quotes = new Array(7)
quotes[0]="a quote here";
quotes[1]="a quote here";
quotes[2]="a quote here";
quotes[3]="a quote here";
quotes[4]="a quote here";
quotes[5]="a quote here";
quotes[6]="a quote here";

now = new Date()

document.write(quotes[now.getDay()]);
document.close()
//-->
</script>

</body>

SDP2006
06-29-2003, 01:12 PM
Works great. Thanks-a-million