View Full Version : Random Text box (fpr 24 hours per text)

08-31-2007, 03:59 PM

A friend has been asking about some sort of a script that can be used on websites.

What they have are a list of quotes, from different people, and what theyw ould like to do is have a box on their website, say, the home page, and then every 24 hours, the quote changes, instead of simply having a 'random quote box' which displays randomly every time you refresh the page.

They want it so visitors may take the code and place it on their own websites and blogs if they want to.


09-01-2007, 06:00 AM
You might want to ask the javascript people. This isn't an xhtml/css question. =)

The Javascript Source might have something like that though if you are up for browsing: http://javascript.internet.com/

09-02-2007, 12:16 AM
Thanks, I'll have a look.

09-02-2007, 08:57 AM
Hi there Aishah,

this simple script will display a different quote for every day of the year....

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
<title>364/365 quotes</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">
#quote {
border:3px double #999;
margin:20px auto;

<script type="text/javascript">
var quotes=new Array();
quotes[0]='quote one'; //first quote of the year
quotes[1]='quote two';
quotes[2]='quote three';

quotes[244]='quote two hundred and forty five';
quotes[245]='quote two hundred and forty six';
quotes[246]='quote two hundred and forty seven';
quotes[247]='quote two hundred and forty eight';
quotes[248]='quote two hundred and forty nine';
quotes[249]='quote two hundred and fifty';
quotes[250]='quote two hundred and fifty one';
quotes[251]='quote two hundred and fifty two';

quotes[363]='quote three hundred and sixty four';
quotes[364]='quote three hundred and sixty five'; //leap year quote

window.onload=function() {
function displayQuote() {
today=new Date();
zero=new Date(setYear,0,1);



<div id="quote">quote one</div>

...the hard work will be the insertion of all the 365 quotes required. :eek:
Luckily for me, that will be your task. ;)


09-05-2007, 08:33 PM
Thank you for the above. Hope you have a good evening.

09-05-2007, 08:43 PM
No problem, you're welcome. ;)

09-05-2007, 09:37 PM
Hi there Aishah,

I did the coding OK, but obviously could not remember that there are 365 days in a a year. :eek:
So you will need 366 quotes.;)


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum