Bisogna dire che sei creativoOriginariamente 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 == 4 || sendReq.readyState == 0) {
sendReq.open("POST", 'getChat.php?main=1&last=' + lastMessage, true);
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 = '';
}
}
non avevo mai visto utilizzare
encodeURIComponent in questo modoVVoVe:
se provi così forse è meglio
Codice PHP:
encodeURIComponent(document.getElementById('txt_message').value)
![]()
![]()