// random quotes function var quotes = [""How many legs does a dog have if you call the tail a leg? Four; calling a tail a leg doesn't make it a leg." - A.Lincoln", ""Truth is generally the best vindication against slander." - A.Lincoln" , ""You can fool some of the people all of the time, and all of the people some of the time, but you can not fool all of the people all of the time." - A.Lincoln"]; function getRandomQuote(){ numberOfQuotes = quotes.length; randNum = Math.floor(Math.random()*numberOfQuotes); return quotes[randNum]; } Code (markup): Don't know js to save my arse, but was wondering if there might be a continuous loop for refreshing the quote array, say, every 6 seconds? Gracias para la ayuda!
call this function setInterval("getRandomQuote()",6000); out side of your function for example: <script language="javascript"> // random quotes function var quotes = [""How many legs does a dog have if you call the tail a leg? Four; calling a tail a leg doesn't make it a leg." - A.Lincoln", ""Truth is generally the best vindication against slander." - A.Lincoln" , ""You can fool some of the people all of the time, and all of the people some of the time, but you can not fool all of the people all of the time." - A.Lincoln"]; function getRandomQuote(){ numberOfQuotes = quotes.length; randNum = Math.floor(Math.random()*numberOfQuotes); alert(quotes[randNum]); } setInterval("getRandomQuote()",6000); </script> Code (markup):