标签:ken name min doc proc reload success out 提交
//图片上传 $(‘#upload‘).change(function(){ var img = document.getElementById("upload").files[0]; var form = new FormData(); form.append("img", img); form.append("_token","{{ csrf_token() }}"); console.log(form); $.ajax({ type: ‘post‘, // 提交方式 get/post url: ‘/admin/brand/upload‘, // 需要提交的 url data: form, processData: false, contentType : false, success: function(data){ console.log(data); layer.msg(‘已添加!‘,{icon:1,time:1000}); setTimeout(function(){ window.parent.location.reload(); var index = parent.layer.getFrameIndex(window.name); parent.layer.close(index); },2000); }, error: function(XmlHttpRequest, textStatus, errorThrown){ layer.msg(‘error!‘,{icon:1,time:1000}); } }); });
标签:ken name min doc proc reload success out 提交
原文地址:https://www.cnblogs.com/xiaogou/p/11659857.html