In mootools I would do something like $(\'form_id\').send({success:function(res){....}});
What is the parallel syntax in jQuery?
Another words:
How
This should do it:
$.ajax({
type: 'POST',
url: url,
data: $('#bob').serialize(),
success: success,
dataType: dataType
});
There is nothing that ships with jQuery that will automatically AJAXify a normal form for you.
Option 1 -- Intercept the form's submit event, scrape the data from form fields using serialize, and send using ajax or post, as suggested.
Option 2 -- Use this great forms plugin, which does all of option 1 for you.
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
}
});
});
$.post()
or $.ajax()
$.ajax({
type: 'POST',
url: url,
data: data,
success: success,
dataType: dataType
});
The documentation will explain it best: http://api.jquery.com/jQuery.post/