>>à mon avis, ça serait plutôt
>>xhr.open("GET", "reponse.php", true);
>>var it = docXML.getElementsByTagName("donnee");
>>for ( var i=0; i>{ alert ( it[i].firstChild.nodeValue ); }
>>déjà... sans préjuger du reste
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionErreur : syntax erroravec une flèche qui pointe le ;
Fichier Source : file:...reponse.htm
Ligne : 13, Colonne : 40
Code Source :
xhr.onreadystatechange = function() ;
xhr.onreadystatechange = function() ;
xhr.onreadystatechange = function() { if (xhr.readyState 4 && (xhr.status 200 || xhr.status == 0)) { var docXML= xhr.responseXML; var it = docXML.getElementsByTagName("donnee") var nom=unescape(self.location.pathname).split('/'); var pag=nom[nom.length-1]; var sui=0; //on fait juste une boucle sur chaque element "donnee" trouvé for (i=0;i= it.length ) { sui=0; } break; } } setTimeout ( function() { location.replace( it[sui].firstChild.nodeValue); },1000 ); }
var nom=self.location.pathname; var sui=0; //on fait juste une boucle sur chaque element "donnee" trouvé for (i=0;i= it.length ) { sui=0; } break; } } setTimeout ( function() { location.replace( it[sui].firstChild.nodeValue); },1000 );
}
var xhr=null;
function ajax()
{
if (window.XMLHttpRequest)
{ xhr = new XMLHttpRequest(); }
else { if (window.ActiveXObject)
{ xhr = new ActiveXObject("Microsoft.XMLHTTP"); }
}
xhr.onreadystatechange = function()
{ if(xhr.readyState == 4)
{ var sui=0;
var nom=self.location.pathname.split("/");;
var pag=nom[nom.length-1];
it=xhr.responseXML.getElementsByTagName("donnee");
for (var i=0; i= it.length )
{ sui=0; }
break;
}
}
setTimeout ( function() { location.replace( it[sui].firstChild.nodeValue); },1000 );
}
}
xhr.open("GET", "reponse.xml", true);
xhr.send(null);