Salve, avendo questi codici per far in modo che una frase cambi ogni 5 secondi, non capisco perchè setInterval non funzioni.. I codici sono i seguenti:
Ho provato anche senza window. prima ma niente..codice:<HTML> <HEAD> <TITLE></TITLE> <script type ="text/javascript"> function getQuote() { var mtQuotes = new Array(); mtQuotes[0] = "I smoke in moderation, only one cigar at a time."; mtQuotes[1] = "Be careful of reading health books, you might die of a misprint."; mtQuotes[2] = "Man is the only animal that blushes or needs to."; mtQuotes[3] = "Clothes make the man. Naked people have little or no influence on society."; mtQuotes[4] = "One of the most striking differences between a cat and a lie is that a cat has only nine lives."; var randValue = Math.floor(Math.random() * mtQuotes.length); document.write(mtQuotes[randValue]); } window.setInterval("getQuote()", 500); </script> </HEAD> <BODY onload="getQuote();"> </BODY> </HTML>

Rispondi quotando