[jQuery] ajaxForm seems to be doing extra get...
This one has me seriously confused. I have a popup that can contain
one of many different forms, and I want to do an ajaxSubmit. Here is
the (simplified) code:
// If the popups contains a form, capture submits.
var $form = $('form', '#popups-body');
$form.ajaxForm({
dataType: 'json',
});
I have watched this work in Firebug, and it does the POST correctly,
submitting the form parameters. But then it immediately follow it
with a mysterious GET.
I tried replacing it with:
$(":submit", $form).bind('click', function(e) {
$form.ajaxSubmit({
type: 'post',
dataType: 'json',
});
return false;
});
Which had the exact same result, expected POST followed immediately by
an unexpected GET.
Just on a lark, I also tried this:
$(":submit", $form).bind('click', function(e) {
$(this).ajaxSubmit({
type: 'post',
dataType: 'json',
});
return false;
});
And this only triggered the one POST, but (not surprisingly) it
doesn't send any form values in the POST, so it is unsuccessful.
I am using jQuery 1.2.6 and Forms Plugin 2.12. I think this exact
same bit of code did not have this issue with jQuery 1.2.3 and Forms
Plugin 2.01
Thanks for any help,
-tao
Any clues much appriciated.