Skip to content

Instantly share code, notes, and snippets.

@jaredhoyt
Created March 30, 2011 19:50
Show Gist options
  • Save jaredhoyt/895156 to your computer and use it in GitHub Desktop.
Save jaredhoyt/895156 to your computer and use it in GitHub Desktop.
Submitting a form and reloading results via ajax (jQuery)
<script type="text/javascript">
jQuery(function(){
$('form').submit(function(event){
$.post(form.action, $(form).serializeArray(), function(response){
$('table').html($(response).find('table').children());
});
event.preventDefault();
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment