Ciao ho questa funzione:
come mai non mi passa il parametro della variabile "params"?codice:var cardProgram = (data) => { var params = "data=" + data; let url = "/script/card_program.php"; let xhttp = new XMLHttpRequest(); xhttp.open("POST", url, true); xhttp.onreadystatechange = function() { if (xhttp.status === 200 && xhttp.readyState === 4) { let response = xhttp.responseText; cntCards.innerHTML = response; cntCards.classList.add("show"); } } xhttp.send(params); }
ricevo questo errore:
Notice: Undefined index: data in ... on line 2

Rispondi quotando