salve,
ho qualche problema a far spedire un modulo col metodo POST per una chat Ajax.
Dove sbaglio?
codice:if(!window.XMLHttpRequest){ var XMLHttpRequest = function(){ try{ return new ActiveXObject("MSXML3.XMLHTTP")} catch(e) {} try{ return new ActiveXObject("MSXML2.XMLHTTP.3.0")} catch(e) {} try{ return new ActiveXObject("MSXML2.XMLHTTP")} catch(e) {} try{ return new ActiveXObject("Microsoft.XMLHTTP")} catch(e) {} } } var Http = new XMLHttpRequest(); var wajax = 'http://www.nomesito.com/script/'; function sendChat(){ var param = 'message=' + document.getElementById('txt_message').value+'&userid='+userid+'&chat=2'; Http.open("POST", wajax+"chat.php?chat="+room, true); Http.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); Http.setRequestHeader("Content-length", param.length); Http.setRequestHeader("Connection", "close"); Http.onreadystatechange = function(){ if(Http.readyState == 4 && Http.status == 200){ document.getElementById('txt_message').value = ''; document.getElementById('chat-text').innerHTML = Http.responseText; } } Http.send(param); }
grazie mille in anticipo a chi vorrà aiutarmi,![]()

Rispondi quotando
