苹果手机safari浏览器layui提交botton 线上无反应ajax请求

版权声明:版权??? 版权.... 版权!!! 什么样的事要说三遍 https://blog.csdn.net/qq_16513911/article/details/86621151

在网上查了很多,给ajax添加了一些属性字段也不知道有没有用,但最后尝试起作用的是下面这句话

 style="cursor:pointer" 
	<botton  lay-submit lay-filter="formDemo" style="cursor:pointer" >提 交</botton>

ajax请求如下(我感觉没啥用,就是上面少了一个样式)

  layui.use('form', function(){
            var form = layui.form;

            //监听提交
            form.on('submit(formDemo)', function(data){
                $.ajax({
					url:"/message",
					data:data.field,
                    dataType:"json",
					type:"post",
                    headers: {
                        'Content-Type': 'application/x-www-form-urlencoded'  //multipart/form-data;boundary=--xxxxxxx   application/json
                    },
                    success:function (o) {
						if (o){
                            layer.msg("提交成功")
						}else{
                            layer.msg("提交失败,请稍后再试")
						}
                    }
				})
               // layer.msg(JSON.stringify(data.field));
                return false;
            });
        });

猜你喜欢

转载自blog.csdn.net/qq_16513911/article/details/86621151