ajax 表单提交

版权声明:作者:她如花似玉 转载请标明出处,原文地址: http://blog.csdn.net/qq_32566003 https://blog.csdn.net/qq_32566003/article/details/79442400
$.ajax({
            url:"",
            type:"POST",
            data:$("#editForm").serialize(),
            beforeSend:function(){
                index = layer.load(0, {
                    shade: [0.5,'#fff'] //0.1透明度的白色背景
                });
            },
            complete: function () {
                layer.close(index);
            },
            success:function(result){
                if(result.code==200){
                    layer.alert(result.msg,function () {
                        layer.closeAll();

                    });
                }else{
                    if(result.msg!=null && result.msg!=""){
                        layer.msg(result.msg);
                    }else{
                        layer.msg("失败");
                    }
                }

            }
        })

    }

});

猜你喜欢

转载自blog.csdn.net/qq_32566003/article/details/79442400