par
arbilus » 28 mai 2010, 15:25
Bonjours, j'ai trouvé ce code qui permet d'afficher une des textes au hasard. J'aurais aimer faire en sorte qu'une fois le texte affiché celui-ci se supprime automatiquement du contenu de la page (du code).
Voici le code:
<SCRIPT LANGUAGE="Javascript"><!--
// ***********************************************
// AUTHOR:
WWW.CGISCRIPT.NET, LLC
// URL:
http://www.cgiscript.net
// Use the script, just leave this message intact.
// Download your FREE CGI/Perl Scripts today!
// (
http://www.cgiscript.net/scripts.htm )
// ***********************************************
function text() {
};
text = new text();
number = 0;
// textArray
text[number++] = "Random text string 1."
text[number++] = "Random text string 2."
text[number++] = "Random text string 3."
text[number++] = "Random text string 4."
text[number++] = "Random text string 5."
text[number++] = "Code Allopass"
// keep adding items here...
increment = Math.floor(Math.random() * number);
document.write(text[increment]);
//--></SCRIPT>
J'ai beau cherché, j'ai rien trouvé à ce sujet
Bonjours, j'ai trouvé ce code qui permet d'afficher une des textes au hasard. J'aurais aimer faire en sorte qu'une fois le texte affiché celui-ci se supprime automatiquement du contenu de la page (du code).
Voici le code:
<SCRIPT LANGUAGE="Javascript"><!--
// ***********************************************
// AUTHOR: WWW.CGISCRIPT.NET, LLC
// URL: http://www.cgiscript.net
// Use the script, just leave this message intact.
// Download your FREE CGI/Perl Scripts today!
// ( http://www.cgiscript.net/scripts.htm )
// ***********************************************
function text() {
};
text = new text();
number = 0;
// textArray
text[number++] = "Random text string 1."
text[number++] = "Random text string 2."
text[number++] = "Random text string 3."
text[number++] = "Random text string 4."
text[number++] = "Random text string 5."
text[number++] = "Code Allopass"
// keep adding items here...
increment = Math.floor(Math.random() * number);
document.write(text[increment]);
//--></SCRIPT>
J'ai beau cherché, j'ai rien trouvé à ce sujet