-
Buongiorno ho trovato questo codice ma non funziona più ho provato a fare delle modifiche con esito negativo chiedo aiuto grazie
<script> function getText() { var $a = document.getElementById('text').value; xhr = new XMLHttpRequest(); xhr.open('POST' , 'chatdb.php',true); xhr.setRequestHeader('content-type','application/x-www-form-urlencoded'); xhr.send('chat='+$a); xhr.onreadystatechange=function(){ if (xhr.responseText){ // document.getElementById('chatarea').innerHTML=xhr.responseText; } } } function setText(){ xhr = new XMLHttpRequest(); xhr.open('POST' , 'chatFetch.php' , true); xhr.setRequestHeader('content-type','application/x-www-form-urlencoded'); xhr.send(); xhr.onreadystatechange = function(){ // alert(xhr.responseText); document.getElementById('chatarea').innerHTML = xhr.responseText; } } setInterval("setText()",2000); setInterval("users()",3000); function users(){ xhr1 = new XMLHttpRequest(); xhr1.open('POST' , 'userFetch.php' , true); xhr1.setRequestHeader('content-type','application/x-www-form-urlencoded'); xhr1.send(); xhr1.onreadystatechange = function(){ // alert(xhr.responseText); document.getElementById('loginperson').innerHTML = xhr1.responseText; } } </script>
Ciao! Sembra che tu sia interessato a questa conversazione, ma non hai ancora un account.
Stanco di dover scorrere gli stessi post a ogni visita? Quando registri un account, tornerai sempre esattamente dove eri rimasto e potrai scegliere di essere avvisato delle nuove risposte (tramite email o notifica push). Potrai anche salvare segnalibri e votare i post per mostrare il tuo apprezzamento agli altri membri della comunità.
Con il tuo contributo, questo post potrebbe essere ancora migliore 💗
Registrati Accedi