如何刷新其他页面的索引


how to refresh index from another page

我有一个简单的网格,显示了数据库中项目的一些信息。这是index.php。当用户想要编辑其中一条记录时,他们点击打开另一个页面的链接(edit.php)。当他们完成编辑时,我想找到一种刷新index.php的方法,使其具有更新的信息。有办法做到这一点吗?


我发现并修改了它,似乎效果很好。

function onFocus(){
    location.reload();
};

if (/*@cc_on!@*/false) { // check for Internet Explorer
    document.onfocusin = onFocus;
    document.onfocusout = onBlur;
} else {
    window.onfocus = onFocus;
    window.onblur = onBlur;
}

使用javascript 从子窗口刷新父窗口

 opener.location.reload();
function onFocus(){
    location.reload();
};

if (/*@cc_on!@*/false) { // check for Internet Explorer
    document.onfocusin = onFocus;
    document.onfocusout = onBlur;
} else {
    window.onfocus = onFocus;
    window.onblur = onBlur;
}