var index=parent.layer.getFrameIndex(window.name); //获取当前窗口的name
parent.layer.close(index);//关闭当前窗口
window.parent.location.reload();//刷新
例子:==========================================
layui.use(['jquery','form','layer'], function(){
var $ = layui.jquery,
layer = layui.layer,
form = layui.form;
form.on('submit(tijiao)', function(data){
$.ajax({
url:'/users/updateUser',
data:data.field,
type:"Post",
dataType:"json",
success:function(data){
var index=parent.layer.getFrameIndex(window.name); //获取当前窗口的name
parent.layer.close(index);
window.parent.location.reload();
},
error:function(data){
$.messager.alert('错误',data.msg);
}
});
return false;
});
})