Categoría: JavaScript
De enunpimpam
(Página creada con «Traer datos con fetch <syntaxhighlight lang="js"> fetch("https://randomuser.me/api/") .then(function(response) { console.log(response) }) .catch(function(respons…») |
|||
Línea 1: | Línea 1: | ||
Traer datos con fetch | Traer datos con fetch | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<syntaxhighlight lang="js"> | <syntaxhighlight lang="js"> | ||
fetch("https://randomuser.me/api/") | fetch("https://randomuser.me/api/") |
Revisión del 10:41 31 jul 2020
Traer datos con fetch
fetch("https://randomuser.me/api/")
.then(function(response) {
// console.log(response)
return response.json()
})
.then(function (Usuario){
console.log('Todo los datos en Array', Usuario)
console.log('Solo el Nombre:', Usuario.results[0].name.first)
})
.catch(function(response) {
})
})
Páginas en la categoría «JavaScript»
Las siguientes 9 páginas pertenecen a esta categoría, de un total de 9.