Skip to content

Instantly share code, notes, and snippets.

@marti1125
Last active December 19, 2015 11:39
Show Gist options
  • Save marti1125/5949765 to your computer and use it in GitHub Desktop.
Save marti1125/5949765 to your computer and use it in GitHub Desktop.
resultado
$.getJSON('js/estaciones.json', function(response){
$.each(response, function(index, item){
$.each(item, function(index, result){
$('.estaciones').append('<li id="IdEstacion" data-estacion="'+result.estacion+'"><p class="nombreEstacion">Estación <b>'+result.estacion+'</b></p></li>');
});
});
});
/*$.ajax({
async: true
});*/
function verificar(result){
if($('#IdEstacion').data('estacion') == result){
$('#IdEstacion').addClass('estacionActiva');
console.log($('#IdEstacion').data('estacion'))
console.log('si')
}else {
console.log($('#IdEstacion').data('estacion'))
console.log('no')
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment