Skip to content

Instantly share code, notes, and snippets.

@egomesbrandao
Created July 6, 2012 01:48
Show Gist options
  • Select an option

  • Save egomesbrandao/3057540 to your computer and use it in GitHub Desktop.

Select an option

Save egomesbrandao/3057540 to your computer and use it in GitHub Desktop.
Você consegue fazer Refactoring no código abaixo?
jQuery(function($) {
$('#new-status').on('submit', function() {
$.ajax({
url: '/statuses',
type: 'POST',
dataType: 'json',
data: {text: $(this).find('textarea').val()},
success: function(data) {
$('#statuses').append('<li>' + data.text + '</li>');
}
});
return false;
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment