prova ad usare questa codice x la chiamata ajax
codice:
function objAjx(){
var xmlhttp = null;
if(window.XMLHttpRequest)
{
xmlhttp = new XMLHttpRequest(); // Gecko (Firefox, Moz), KHTML (Konqueror, Safari), Opera, Internet Explorer 7
}
else if(window.ActiveXObject)
{
try
{
xmlhttp = new ActiveXObject("MSXML2.XMLHTTP"); // Internet Explorer 6
}
catch(e)
{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); // Internet Explorer 4,5
}
}
else
{
xmlhttp = null;
}
return xmlhttp;
};
function PageAjax(url,pagina,div){
//alert(azione)
AjaX = objAjx();
if(AjaX){
//Invio i dati in post
var separa = url.split("?")
send = separa[1]
str = separa[0]
AjaX.open("POST", pagina+str, true);
AjaX.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
AjaX.send(send);
AjaX.onreadystatechange=function(){
//alert(AjaX.responseText)
if(AjaX.readyState != 4)document.getElementById(div).innerHTML="Attendere prego......."
//Se è andato tutto bene faccio vedere il risultato
if (AjaX.readyState == 4 && AjaX.status==200){
//qui va la risposta in modalità post
}
}
}
}