错误的写法:

$(this).submit(function () {
$(this).ajaxSubmit({
url: opts.url,
type: 'post',
dataType: 'json',
beforeSubmit: function () {
opts.beforeSubmit();
},
success: function (result) {
opts.success(result);
}
});
return false;
}).submit();

下面是正确的写法:

$(this).ajaxSubmit({
url: opts.url,
type: 'post',
dataType: 'json',
beforeSubmit: function () {
opts.beforeSubmit();
},
success: function (result) {
opts.success(result);
}
});
return false;

去掉了外层的Jquery的submit提交。

05-17 08:42