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 verif_compte(){
getXhr();
xhr.onreadystatechange = function(){
if(xhr.readyState == 4 && xhr.status == 200){
leselect = xhr.responseText;
if (leselect=="") {
...
}
else if (leselect=="mail") {
...
}
else if (leselect=="pass") {
...
}
}
}
xhr.open("POST","test_compte.php",true);
xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
sel = document.getElementById('email');
idmail = sel.value;
sell = document.getElementById('pass');
idpass = sell.value;
xhr.send("idmail="+idmail+"&idpass="+idpass);
} |
Partager