Created
July 6, 2012 01:48
-
-
Save egomesbrandao/3057540 to your computer and use it in GitHub Desktop.
Você consegue fazer Refactoring no código abaixo?
This file contains hidden or 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
| 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