标签:sage err var jquery json field frame update 页面
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;
});
})
标签:sage err var jquery json field frame update 页面
原文地址:https://www.cnblogs.com/songyinan/p/13261822.html