有个需求,30S自动保存页面数据,但是不能刷新当前页面,用ajax提交表单数据

data:$(#formId).serialize()

$.ajax({
                        //几个参数需要注意一下
                        type: "POST",//方法类型
                        dataType: "json",//预期服务器返回的数据类型
                        url: base+"/config/saveBrand.action" ,//url
                        data: $('#config_add').serialize(),
                        success: function (result) {
                            if(result="S"){
                                layer.close(loading);
                                layer.close(index);
                                var tip = tips("#save-success-tips1");
                                setTimeout(function(){
                                    window.location.reload(); 
                                },1000);
                            }
                            
                        },
                        error : function() {
                            console.log("异常!");
                        }
                    });

 

相关文章:

  • 2021-11-27
  • 2022-03-08
  • 2022-12-23
  • 2021-11-27
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
猜你喜欢
  • 2022-12-23
  • 2021-09-14
  • 2022-12-23
  • 2021-12-06
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
相关资源
相似解决方案