Skip to content

Instantly share code, notes, and snippets.

@fomkin
Last active August 29, 2015 14:07
Show Gist options
  • Save fomkin/90dfdfee82a62ba80d86 to your computer and use it in GitHub Desktop.
Save fomkin/90dfdfee82a62ba80d86 to your computer and use it in GitHub Desktop.
function processData(data) {
for(var i = 0; i < data.length; i++) {
var row = $('<tr></tr>')
.append($('<td>' + data[i].id + '</td>'))
.append($('<td>' + data[i].firstName + '</td>'))
.append($('<td>' + data[i].secondName + '</td>'));
if ($('showCountryCheckbox').checked) {
row.append($('<td>' + data[i].country + '</td>'));
}
$('table').append(row);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment