Voici le code, auquel j'ai ajouté la définition du scrolltop :
var xmlhttps= new Array();
function loadXMLdoc(url, id, attente) {
var i= xmlhttps.length;
if(attente != null) {
document.getElementById(id).innerHTML= attente;
}
if(window.XMLHttpRequest) {
xmlhttps[i]= new XMLHttpRequest();
xmlhttps[i].onreadystatechange= function() { xmlhttpChange(i, url, id); };
xmlhttps[i].open("POST", url, true);
xmlhttps[i].send(null);
}
else if(window.ActiveXObject) {
xmlhttps[i]= new ActiveXObject("Microsoft.XMLHTTP");
if(xmlhttps[i]) {
xmlhttps[i].onreadystatechange= function() { xmlhttpChange(i, url, id); };
xmlhttps[i].open("GET", url, true);
xmlhttps[i].send();
}
}
}
function xmlhttpChange(i, url, id) {
if(xmlhttps[i].readyState==4) {/*complete*/
if(xmlhttps[i].status < 400) {
document.getElementById(id).innerHTML= xmlhttps[i].responseText;
document.getElementById(id).scrolltop = document.getElementById(id).scrollheight;
}
else {
document.getElementById(id).innerHTML= "[<span title=\""+url+"\">Erreur "+xmlhttps[i].status+"</span>]";
}
}
}
Nitruk