Originariamente inviato da Mary Angy
grazie, ma l'ho messo così (è giusto?)e non viene lo stesso
Codice PHP:
            function sendChatText() {
                if (
document.getElementById(encodeURIComponent('txt_message')).value == '') {
                    
alert("Non hai scritto niente");
                    return;
                }
                if (
sendReq.readyState == || sendReq.readyState == 0) {
                    
sendReq.open("POST"'getChat.php?main=1&last=' lastMessagetrue);
                    
sendReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
                    
sendReq.onreadystatechange handleSendChat
                    var 
param 'message=' document.getElementById(encodeURIComponent('txt_message')).value;
                    
param += '&chat=1';
                    
sendReq.send(param);
                    
document.getElementById(encodeURIComponent('txt_message')).value '';
                }                           
            } 
Bisogna dire che sei creativo
non avevo mai visto utilizzare
encodeURIComponent in questo modo VVoVe:


se provi così forse è meglio
Codice PHP:
encodeURIComponent(document.getElementById('txt_message').value