1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
function fermer()
{
var texte= '';
try{
document.getElementById("ID DE LA DIV").innerHTML = "Page en cours de chagement";
}catch(e){
alert(e.description());
}
var xmlhttp=false;
try{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
try{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}catch(E){
xmlhttp = false;
}
}
if(!xmlhttp && typeof XMLHttpRequest!='undefined'){
try{
xmlhttp = new XMLHttpRequest();
} catch (e){
xmlhttp = false;
}
}
if(!xmlhttp && window.createRequest){
try{
xmlhttp = window.createRequest();
} catch(E){
xmlhttp = false;
}
}
xmlhttp.open('POST','FICHIER.PHP',true);
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4) {
if(document.getElementById){
document.getElementById("ID DE LA DIV").innerHTML = xmlhttp.responseText;
}
}
}
xmlhttp.setRequestHeader('Content_type','application/x-www-form-urlencoded');
var data = 'texte='+escape(texte);
xmlhttp.send(data);
} |
Partager