| 1 | import { consume } from "../libclienteweb/consume.js" |
| 2 | import { descargaVista } from "../libclienteweb/descargaVista.js" |
| 3 | import { recibeJson } from "../libclienteweb/recibeJson.js" |
| 4 | |
| 5 | descargaDatos() |
| 6 | |
| 7 | async function descargaDatos() { |
| 8 | await descargaVista("api/vista-administrador.php") |
| 9 | const botonSaludo = document.querySelector("#botonSaludo") |
| 10 | if (botonSaludo) { |
| 11 | botonSaludo.addEventListener("click", saludo) |
| 12 | } |
| 13 | } |
| 14 | |
| 15 | async function saludo() { |
| 16 | const respuesta = await consume(recibeJson('api/saludo-cliente.php')) |
| 17 | const json = await respuesta.json() |
| 18 | alert(json) |
| 19 | } |
| 20 | |