Skip to content

Instantly share code, notes, and snippets.

@kimjoar
Created July 31, 2013 10:36
Show Gist options
  • Save kimjoar/6121024 to your computer and use it in GitHub Desktop.
Save kimjoar/6121024 to your computer and use it in GitHub Desktop.
$(document).ready(function() {
$('#new-status form').submit(function(e) {
e.preventDefault();
$.ajax({
url: '/status',
type: 'POST',
dataType: 'json',
data: { text: $('#new-status').find('textarea').val() },
success: function(data) {
$('#statuses').append('<li>' + data.text + '</li>');
$('#new-status').find('textarea').val('');
}
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment