[AJAX] transmettre plusieurs variables par get
Question de débutant Ajax :
Comment faire pour transmettre plus d'une variable avec une méthode GET ?
Je bloque là :
Code:
var data = "mat="+matric; url +=data;
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| function matricule()
{
var xmlHttp = xhr();
var reponse1 = document.getElementById('reponse1_caces');
var selection = document.getElementById('matric');
var matric = selection.options[selection.selectedIndex].value;
if(matric=='-1'){
reponse1.innerHTML = '';
}
else {
var url = "./parametre/caces/reponse1_caces.php?";
var data = "mat="+matric; url +=data;
xmlHttp.open("get",url,true);
xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState==4 && xmlHttp.status==200)
{
reponse1.innerHTML = xmlHttp.responseText;
}
}
xmlHttp.send(null);
}
} |