[AJAX] attribuer innerHTML en retour AJAX
Bonjour,
Je possède sur une page Internet, 3 radio bouton ainsi selon celui sur lequel on appuie, je voudrais afficher une page différente :
Voici le code
Principal
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
<form name="form1" method="post" action="">
<center>
<input type="radio" name="radiobutton" value="radiobutton" onChange="change('forfaits');">
Forfaits
<span style="margin-left:130px;"><input type="radio" name="radiobutton" value="radiobutton" onChange="change('majors');"></span>
Chargements
<span style="margin-left:130px;"> <input type="radio" name="radiobutton" value="radiobutton" onChange="change('demonstrations');">
</span>
Démonstrations
</center><br><br>
</form>
<div id="champ"><br></div> |
Fonction
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
function change(choix)
{
var url;
switch(choix){
case 'forfaits' : url='choix_forfait.php';
break;
case 'majors' : url='choix_majors.php';
break;
case 'demonstrations' : url='choix_demonstrations.php';
break;
}
getXhr();
xhr.onreadystatechange = function(){
if(xhr.readyState == 4 && xhr.status == 200){
document.getElementById('champ').innerHTML=xhr.responseText;
}
}
xhr.open("GET",url,true);
xhr.send(null);
} |
En local :
Firefox : marche trés bien
IE : Marche avec un décalage
En ligne :
Ca ne fonctionne pas du tout
Savez vous d'ou peut provenir le probleme ?
Merci
Informations :
Serveur : Linux (fedora 8)
IE 7
Firefox 2