salve a tutti ragazzi,ho notato che il mio script AJAX ha problemi con il browser Internet Explorer,mentre con mozilla Firefox va che è una meraviglia.
Il punto è questo:
Il mio script AJAx invia delle variabili tramite metodo POST e le recupero in un file tramite PHP...in firefox tutto bene,mentre in Explorer resta in attesa di una risposta sempre...ecco il code:
codice:
function getXML()
{
try{
return new XMLHttpRequest();
}catch(e){}
try{
return new ActiveXObject('Msxml2.XMLHTTP');
}catch(e){}
try{
return new ActiveXObject('Microsoft.XMLHTTP');
}catch(e){}
}
function send_var() {
xml = getXML();
var request = 'var='+ escape(document.modulo.testo.value);
document.body.innerHTML = 'Loading...';
xml.open("POST", 'recovery.php', true);
xml.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xml.setRequestHeader("Content-length", request.length);
xml.setRequestHeader("Connection", "close");
xml.onreadystatechange = function() {
if (xml.readyState == 4 && xml.status == 200) {
document.body.innerHTML = xml.responseText;
}
}
xml.send(request);
}
non capisco il perchè Explorer non viene supportato...
Qualcuno mi può dire cosa fare per far si che lo script giri bene anche su IE?
grazie in anticipo!!!