JQuery 关闭子页面,刷新父页面

来源:互联网 发布:linux 每10秒 shell 编辑:程序博客网 时间:2024/05/18 03:04

注意,这三个方法缺一不可

1,执行完ajax方法以后关闭子页面,这个方法是写在子页面的!

if(parent != null && parent.closePopBox != null && typeof(parent.closePopBox) == "function"){                        parent.closePopBox();//关闭子页面}

2,刷新父页面,这个方法只需要随便找个地方放入就行!

function closePopBox(){    $(".webox").find("iframe").removeAttr("src");    $(".webox").remove();    $(".background").remove();    refreshTableData();}function refreshTableData(){    $('#dg').datagrid('reload');//要刷新的哪个表格}

3.弹出窗口的写法,这个方法,仅限于和上面的两个写法,
//这个方法要写在父页面,父页面打开子页面的方法

function openAddForm() {        $.webox({            width : 1050,            height : 460,            bgvisibel : true,            title : "Kqi Name",            allscreen : false,            iframe : openAddpage//要打开页面的URL地址        });    }

//打开地址的URL

var openAddpage = localUrl + "/plugins/sqm/servicemode/updateLevel.jsp";
原创粉丝点击