
Originariamente inviata da
supermac
Grazie vic
quindi adattando il mio codice a quanto mi suggerisci, secondo te questa in asincrono dovrebbe andare? (sempre se A) ho capito bene, B) l'ho scritta giusta... secondo quel che dice Andrea tu hai usato il POST ma andava usato GET)
codice:
function processBarcode(bc) {
var e = document.getElementById("ddlconti");
var conto = e.options[e.selectedIndex].value;
var httpRequest = new XMLHttpRequest();
httpRequest.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var risposta =this.responseText;
if (risposta == 'True') {
//mostro labels
document.getElementById("matri").display = "block";
document.getElementById("scans").innerHTML += "<div>" + bc + "</div>";
document.getElementById("bottoni").style.display = "block";
} else {
alert('MATRICOLA NON ACCETTATA!');
}
}
};
httpRequest.open('GET', "maincheck.ashx?c="+conto+"&m="+bc, true);
httpRequest.send();
}