$(document).ready(function() { $('form').on('submit', function(e){ e.preventDefault(); var formData = $(this).serialize(); // get data from form field $.post('/grandma', formData, function(response) { $('#grandma_message').text(response.grandma_response); }); // create a new ajax request with data // take response ajax call gives us and perform logic (inserting data we receive back into dom) }); // This is called after the document has loaded in its entirety // This guarantees that any elements we bind to will exist on the page // when we try to bind to them // See: http://docs.jquery.com/Tutorials:Introducing_$(document).ready() });