Last active
August 29, 2015 14:03
-
-
Save coderdiaz/422362ee7b701c86dc4c 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
$(document).ready(function(){ | |
$('#getDatos').click(function(){ | |
$.ajax({ | |
url: 'consulta.php', | |
success: function(data){ | |
$("p").remove(); | |
console.log(data); //<=== Esta puede ser removida; | |
var datos = $.parseJSON(data); | |
console.log(datos); //<=== Esta puede ser removida; | |
$.each(datos, function(i, row) { | |
var fila = $('<tr/>'); | |
$.each(row, function(name, value) { | |
$('<td/>', { | |
text: value | |
}).appendTo(fila); | |
}); | |
fila.appendTo('#datos'); | |
}); | |
} | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment