Skip to content

Instantly share code, notes, and snippets.

@elbuo8
Created February 28, 2013 00:57
Show Gist options
  • Save elbuo8/5053301 to your computer and use it in GitHub Desktop.
Save elbuo8/5053301 to your computer and use it in GitHub Desktop.
extends layout
block content
div#form
input#userID(type='text', name='user', placeholder='enter username')
br
textarea(type='textarea', name='text', placeholder='enter tweet', id='tweet')
br
button#submitTweet(type='button') Tweet
block script
script
$(document).ready(function() {
$('#submitTweet').on('click', function() {
console.log("Submitting");
$.post('/submit', {user: $('#userID').val(), tweet:$('#tweet').val()}, function(result) {
$('#form').text(result);
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment