Created
July 5, 2017 21:43
-
-
Save kodamirmo/f717628672a204967099dc8318390428 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var xhr = $.ajax({ | |
url: "http://52.26.247.55:8080/EWS/web/kit", | |
method: "GET", | |
}).done(function(respuesta) { | |
var experiencia = respuesta.data[0]; | |
console.log( "Experiencia: ", experiencia ); | |
var nombre = experiencia.attributes.kit; | |
var descripcion = experiencia.attributes.descripcion; | |
var precio = '$' + experiencia.attributes.precio; | |
var imagen = experiencia.attributes.imagen; | |
if (imagen.indexOf('http') == -1) { | |
imagen = 'http://' + imagen; | |
} | |
$('#nombre').text(nombre); | |
$('#descripcion').text(descripcion); | |
$('#precio').text(precio); | |
$('#imagen').attr('src', imagen); | |
}).fail(function(jqXHR, textStatus) { | |
cosole.log( "error: ", textStatus ); | |
}).always(function() { | |
console.log( "complete" ); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment