Salve, dovrei estrarre un elemento in modo random da un array per poi farlo cambiare ogni tot secondi tramite SetInterval, ho provato questi codici ma non funzionano:
Ovviamente ora non ha il setinterval, l' ho messo così per vedere se funzionavano ma non vanno .. Cosa c'è di sbagliato?codice:<HTML> <HEAD> <TITLE></TITLE> <script type ="text/javascript"> fuction 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]); } </script> </HEAD> <BODY> Testa </BODY> </HTML>