私はjQueryフォームプラグインを使用していて、success関数内でfindメソッドを使用できない理由を理解しようとしています。
$('#signup-form').ajaxForm({
beforeSubmit: function (arr, $form, options) {
$form.find("input[name=email]").css('width', '170');
$form.find("input[type=submit]").val('Subscribing...').attr('disabled', 'true');
},
target: "#signup-form-wrap",
dataType: 'json',
success: function (data, $form) {
$form.find("input[type=submit]").val('Go!').css('width', '200');
}
});
何らかの理由で、次のエラーが発生します。
Uncaught TypeError: Object success has no method 'find'
$ formに警告すると、その値は文字列「success」にすぎません。ただし、beforeSubmitでは機能します。私は何が間違っているのですか?