codice:
<p id="tasto" >continua</p>
<script language="javascript">
function ripete()
{
dati= document.getElementById('tasto').innerHTML;
if (dati== "continua"){
if(window.XMLHttpRequest){
xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET","aggiorna.php",false);
xmlhttp.send(null);
}
else{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("GET","aggiorna.php",false);
xmlhttp.send();
}
document.getElementById('tasto').innerHTML = xmlhttp.responseText;
}
dati= document.getElementById('tasto').innerHTML;
if(dati== "siuno"){
alert ('Hai vinto! Complimenti!!!');
document.getElementById('fine').submit();}
if(dati== "nouno"){
alert('Sei morto.');
document.getElementById('fine').submit();}
}
ripete();
</script>
può bastare???
la pagina "aggiorna.php" scrive "siuno", sono sicuro al 100%, ma non funziona!