Skip to content

Instantly share code, notes, and snippets.

@RimonEkjon
Forked from asfaltboy/submit_form.js
Created August 26, 2014 03:45
Show Gist options
  • Save RimonEkjon/884231a4696612f6b0c4 to your computer and use it in GitHub Desktop.
Save RimonEkjon/884231a4696612f6b0c4 to your computer and use it in GitHub Desktop.
Generic form submission over ajax with jsonp response
$('#form').submit(function() {
payload = $(this).serialize();
$.ajax({
url: 'http://',
type: 'POST',
data: payload,
dataType: 'jsonp'
success: function(data){
// present success message here
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment