Untitled
unknown
javascript
2 years ago
561 B
7
Indexable
function trasmissione(){
var lingua=select.value;
var xhr = new XMLHttpRequest();
//👇 set the PHP page you want to send data to
xhr.open("POST", "exe.php", true);
xhr.setRequestHeader("Content-Type", "application/json");
//👇 what to do when you receive a response
xhr.onreadystatechange = function () {
if (xhr.readyState == XMLHttpRequest.DONE) {
alert(xhr.responseText);
}
};
//👇 send the data
xhr.send(JSON.stringify(lingua));
}Editor is loading...