[英]Refresh browser tab when other tab closes
Is there a way to refresh a webpage in one browser tab when another tab is closed? 关闭另一个标签页后,是否可以在一个浏览器标签页中刷新网页?
I have a website which provides the status of a number crafts available for use (let's call it my 'status' tab). 我有一个网站,提供一些可供使用的工艺品的状态(我们称其为“状态”标签)。 Next, I have a vb application which reads a member's HID card and launches a website where they proceed to signout a craft (let's call this my 'signout' tab).
接下来,我有一个vb应用程序,该应用程序读取会员的HID卡并启动一个网站,让他们继续注销工艺品(我们称其为“退出”标签)。 When they are done, I want to close the 'signup' tab and refresh the 'status' tab.
完成后,我要关闭“注册”标签并刷新“状态”标签。
Ideally, I would like to have something like - on the last page of the signout process, determine the tab id of the 'status' tab, refresh it, and auto-close the 'signout' tab 理想情况下,我想使用类似的方法-在退出过程的最后一页上,确定“状态”标签的标签ID,刷新它,然后自动关闭“退出”标签
You can detect tabs, opened by your tab (popup) 您可以检测由标签页打开的标签页(弹出窗口)
function closeCallback() {
//your code here
}
var openTab = function(uri, name, options, closeCallback) {
var win = window.open(uri, name, options);
var interval = window.setInterval(function() {
try {
if (win == null || win.closed) {
window.clearInterval(interval);
closeCallback(win);
}
}
catch (e) {
}
}, 1000);
return win;
};
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.