Skip to content

Instantly share code, notes, and snippets.

@yangli-io
Last active November 18, 2015 08:45
Show Gist options
  • Select an option

  • Save yangli-io/67d76453c5f5bdae7cab to your computer and use it in GitHub Desktop.

Select an option

Save yangli-io/67d76453c5f5bdae7cab to your computer and use it in GitHub Desktop.
var url = 'https://fewd20.herokuapp.com/data';
var usedNames = [];
$('#send').click(function(){
$.get(url, function(data, status){
for (var i = 0; i < data.length; i++) {
if (usedNames.indexOf(data[i].name) === -1) {
usedNames.push(data[i].name);
$('#list').append('<li> name: ' + data[i].name + ' reason :' + data[i].reason + '</li>');
}
}
}).fail(function(){
});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment