Forum Moderators: open
<script type="text/JavaScript">
var quote = new Array();
quote[0] = 'Word 1: Lorem ipsum dolor sit amet, consectetuer adipiscing elit.';
quote[1] = 'Word 2: Nullam commodo venenatis elit. In aliquam.';
quote[2] = 'Word 3: Sed vitae risus ac urna pharetra tristique.';
var firstDate = new Date(2005,0,1);//start date (yyyy,m,d) - m=0=January, m=1=February
var today = new Date();//today
var dif = Math.floor((today-firstDate)/1000/60/60/24);//difference in days
while(dif>=qlen){//calculate the index of the quote of the day
dif=dif-qlen;//restart the array index if the difference is greater that the array's length
}
var todayQuote = quote[dif];//the quote of the day
onload = function(){document.getElementById('q').firstChild.data = todayQuote}
</script>
Any way to do this?