In mootools I would do something like $('form_id').send({success:function(res){....}});
What is the parallel syntax in jQuery?
Another words:
How would I put my form data (assume id='bob') into the following code
$.ajax({
type: 'POST',
url: url,
data: data,
success: success,
dataType: dataType
});
This should do it:
$.ajax({
type: 'POST',
url: url,
data: $('#bob').serialize(),
success: success,
dataType: dataType
});
Wouldn't you know... It's right there in the documentation! :P
http://api.jquery.com/jQuery.ajax/
Edit: okay okay...
$('#too_cool_form').submit(function(e){
e.preventDefault();
//do some verification
$.ajax({
url: '',
data: $(this).serialize(),
success: function(data)
{
//callback methods go right here
}
});
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With