跨页面加载跟踪子窗口 [英] Tracking a child window across page loads

查看:51
本文介绍了跨页面加载跟踪子窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果重新加载父页面,是否可以跟踪子窗口?

Is it possible to track a child window if the parent page is reloaded?

我当前打开窗口如下:

  var childWindow;
  childWindow= window.open('url...');

当我想重新打开相同的子窗口时我会这样做

and when I want to reopen the same child window I do

 childWindow.focus();

显而易见的问题是,如果父窗口刷新,那么它将失去对<$ c $的追踪c> childWindow 并且无法关注它。有没有办法让我对子窗口的引用?

The obvious problem is that if the parent window is refreshed then it loses track of the childWindow and can't focus it. Is there any way to get my reference to the child window back?

推荐答案

也许你可以使用名称参数(第二个)在window.open()中用于在父窗口重新加载时重新加载弹出窗口??

Maybe you could use the name parameter (second one) used in window.open() to "reload" your popup when the parent window reloads... ?

这篇关于跨页面加载跟踪子窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆