3 METODOS POST FETCH JSON ENVIO DATOS HACIA LA API
METODO 1 3-view.html <input type="text" id="caja1"> document.getElementById('caja1').addEventListener('keyup', doSearch); function doSearch () { var caj = document.getElementById("caja1").value; const formData = { n: caj }; fetch("2-controller.php", { method:"POST", headers: { 'Content-Type': 'application/json; charset=utf-8' }, body: JSON.stringify(formData) }) .then(res => res.json()) .then(res => { let results = document.getElementById("results"); results.innerHTML = ""; let output = ''; if (res !== null) { for (let r of res) { results.innerHTML += `<div>${r.id} - ${r.nombre}</div>`; output += ` <tr> ...