Jai un site qui ecrit tout seule copier coller ca

Fermé
justin - 12 nov. 2020 à 20:18
wubi Messages postés 219 Date d'inscription dimanche 2 août 2009 Statut Membre Dernière intervention 6 octobre 2021 - 14 nov. 2020 à 17:26
Bonjour,



function myFunction(){
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="fr" lang="fr" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Frappe auto</title>

<style>
*
{
font-family : arial;
font-size : 12pt;
}

body, html
{
margin : 0px;
padding : 0px;
border : 0px;

}
</style>


<script>
function display()
{
if (cpt >= txt.length) return;
cpt++;
var elt=document.getElementById("txt");
var car = (txt.charCodeAt(cpt)==10) ? '<br />' : txt.substr(cpt,1);

elt.innerHTML=elt.innerHTML+car;

setTimeout("display()",80+Math.round(Math.random()*20));
}

var txt ="";
var cpt =0;

function go()
{
txt=document.getElementById("data").value;
cpt = -1;
document.getElementById("txt").innerHTML="";
setTimeout("display()",100);
}
</script>
</head>
<body>
<h1>Entrez ici le texte qui doit sembler se taper tout seul</h1>
<form id="formulaire">
<textarea id="data" cols="50" rows="10"></textarea>
<input type="button" value="Ok" onclick="go()">
</form>
<p id="txt">
</p>
</body>
</html>
}

3 réponses

wubi Messages postés 219 Date d'inscription dimanche 2 août 2009 Statut Membre Dernière intervention 6 octobre 2021 16
12 nov. 2020 à 20:26
Et alors?
0
choubaka Messages postés 39375 Date d'inscription jeudi 4 avril 2002 Statut Modérateur Dernière intervention 14 avril 2024 2 100
12 nov. 2020 à 20:41
bonsoir

pas mieux .. et???
0
wubi Messages postés 219 Date d'inscription dimanche 2 août 2009 Statut Membre Dernière intervention 6 octobre 2021 16
13 nov. 2020 à 16:45
c' est amusant comme ça
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xml:lang="fr" lang="fr" xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

<title>Confidentiel</title>



<style>
  • {font-family : arial;font-size : 12pt;}body, html{margin : 0px;padding : 0px;border : 0px;}</style><script>function display(){if (cpt >= txt.length) return;cpt++;var elt=document.getElementById("txt");var car = (txt.charCodeAt(cpt)==10) ? '<br />' : txt.substr(cpt,1);elt.innerHTML=elt.innerHTML+car;setTimeout("display()",80+Math.round(Math.random()*20));}var txt ="";var cpt =0;function go(){txt=document.getElementById("data").value;cpt = -1;document.getElementById("txt").innerHTML="";setTimeout("display()",100);}</script></head><body><h1>Voir un message secret</h1><form id="formulaire"><div style=display:none><textarea id="data">Bonjour les amis de Comment ça marche</textarea></div><input type="button" value="Ok" onclick="go()"></form><p id="txt"></p></body></html>

0
wubi Messages postés 219 Date d'inscription dimanche 2 août 2009 Statut Membre Dernière intervention 6 octobre 2021 16
14 nov. 2020 à 17:26
J' ai simplement enlever du code inutile. J' ai entré le texte dans le textarea puis caché le textarea avec un div style=display:none . Alors ça va comme ça Justin?
Je n' ai pas modifié ton Javascript .
0