Skip to content

Instantly share code, notes, and snippets.

@kimjoar
Created July 22, 2012 13:36
Show Gist options
  • Select an option

  • Save kimjoar/3159702 to your computer and use it in GitHub Desktop.

Select an option

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