Ciao a tutti,
ho questo problema. Utilizzo uno script ajax che mi serve per richiamare una sezione di pagina in un div che ha come id 'target' (<div id="target"></div>).
La richiamo tramite link come questo di seguito:
Il problema è che tutto funziona con Firefox ma va in errore IE e non mi carica nulla di nulla.
Il codice ajax utilizzato è il seguente:
codice:
function AJAXReq(method,url,bool){
if(window.XMLHttpRequest){
myReq = new XMLHttpRequest();
} else
if(window.ActiveXObject){
myReq = new ActiveXObject("Microsoft.XMLHTTP");
if(!myReq){
myReq = new ActiveXObject("Msxml2.XMLHTTP"); } }
if(myReq){
execfunc(method,url,bool);
}else{
alert("Impossibilitati ad usare AJAX"); } }
/*Se esiste myReq farà eseguire questa funzione che a sua volta chiamerà una terza funzione*/
function execfunc(method,url,bool){
myReq.onreadystatechange = handleResponse;
myReq.open(method,url,bool);
myReq.send(null); }
function handleResponse(){
if(myReq.readyState == 4){
if(myReq.status == 200){
target = document.getElementById('target');
target.innerHTML = myReq.responseText;
}else{
alert("Niente da fare, AJAX non funziona :(");
} } }
Avete qualche idea di quale può essere l'errore?
Grazie