Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created August 1, 2019 23:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/ee1375cc91266b9fa6160aa259da0834 to your computer and use it in GitHub Desktop.
Save parzibyte/ee1375cc91266b9fa6160aa259da0834 to your computer and use it in GitHub Desktop.
const obtenerListaDeImpresoras = () => {
loguear("Cargando lista...")
fetch(RUTA_API + "/impresoras")
.then(r => r.json())
.then(listaDeImpresoras => {
refrescarNombreDeImpresoraSeleccionada();
loguear("Lista cargada");
limpiarLista();
listaDeImpresoras.forEach(nombreImpresora => {
const option = document.createElement('option');
option.value = option.text = nombreImpresora;
$listaDeImpresoras.appendChild(option);
})
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment