Created
March 30, 2011 19:50
-
-
Save jaredhoyt/895156 to your computer and use it in GitHub Desktop.
Submitting a form and reloading results via ajax (jQuery)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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