错误的写法:

$(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提交。

相关文章:

  • 2022-12-23
  • 2022-01-11
  • 2022-01-04
  • 2022-12-23
  • 2022-01-10
  • 2022-12-23
  • 2021-11-17
  • 2022-12-23
猜你喜欢
  • 2021-06-02
  • 2022-12-23
  • 2021-12-28
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
  • 2021-12-27
相关资源
相似解决方案