Untitled

 avatar
unknown
javascript
a year ago
561 B
1
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...