Skip to content

Instantly share code, notes, and snippets.

@TheCase
Created December 8, 2017 18:39
Show Gist options
  • Save TheCase/574cb685151b7508595155f6a1a92a11 to your computer and use it in GitHub Desktop.
Save TheCase/574cb685151b7508595155f6a1a92a11 to your computer and use it in GitHub Desktop.
$(document).ready(function() {
$('#list-users-button').click(function(){
$.getJSON('https://jsonplaceholder.typicode.com/users',
function (data) {
//console.log("> ", data);
$("#list-results-table tbody").append("<table>");
for ($i=0; $i < data.length; $i++){
$("#list-results-table tbody").append('<tr><td>' + data[$i].name + '</td></tr>');
}
});
});});
#list-users-button {
background-color: green;
color: white;
border-width: 2px;
border-color: #000;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment