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 48 49 50 51 52 53 54 55
|
<script>
function calendrier_ajax (mois,annee)
{
alert(mois+annee);
var xhr;
try
{
xhr = new ActiveXObject('Msxml2.XMLHTTP');
}
catch (e)
{
try
{
xhr = new ActiveXObject('Microsoft.XMLHTTP');
}
catch (e2)
{
try
{
xhr = new XMLHttpRequest();
}
catch (e3)
{
xhr = false;
}
}
}
xhr.onreadystatechange = function()
{
if(xhr.readyState == 4)
{
if(xhr.status == 200)
{
alert(xhr.responseText);
document.getElementById('box_calendrier').innerHTML=xhr.responseText; // <== tu met ton innerhtml
}
else
alert('Erreur'); // <== tu ne fais rien
}
};
xhr.open("GET", "scriptcalendrier.php", true); // <== ta page
var data = "mois=" + mois + "&annnee=" + annee;
xhr.send(data);
}
</script>
</head>
<body>
<div id="box_calendrier">
<?php include 'scriptcalendrier.php'; ?>
</div>
</body> |
Partager