从子窗口重新加载父窗口

时间:2022-09-07 07:24:55

How can I reload my child window's parent using jQuery?

我如何可以重新加载使用jQuery我的子窗口的父?

9 个解决方案

#1


85  

No jQuery is necessary in this situation.

没有jQuery是必要的,这种情况下。

window.opener.location.reload(false);

https://developer.mozilla.org/en-US/docs/Web/API/Window

https://developer.mozilla.org/en-US/docs/Web/API/Window

#2


18  

You can use window.opener, window.parent, or window.top to reference the window in question. From there, you just call the reload method (e.g.: window.parent.location.reload()).

您可以使用window.opener,window.parent,或window.top引用窗口的问题。从那里,你只需要调用重载方法(例如:window.parent.location.reload())。

However, as a caveat, you might have problems with window.opener if you need to navigate away from the originally opened page since the reference will be lost.

但是,作为一个警告,你可能会,如果你需要从最初打开页面导航离去,因为参考将会丢失与window.opener问题。

#3


5  

parent.location.reload();

This should work.

这应该工作。

#4


2  

You can reload parent window location using :

您可以使用以下命令重新加载父窗口位置

window.opener.location.href = window.opener.location.href;

#5


1  

  top.frames.location.reload(false);

#6


0  

Prevents previous data from been resubmitted. Tested in Firefox and Safari.

防止重新提交先前的数据。在Firefox和Safari中测试过。

top.frames.location.href = top.frames.location.href;

#7


0  

window.parent.opener.location.reload();

worked for me.

为我工作。

#8


0  

This working for me:

这对我有用:

  window.opener.location.reload()
  window.close();

In this case Current tab will close and parent tab will refresh.

在这种情况下,当前选项卡将关闭,父选项卡将刷新。

#9


0  

this will work

这将工作

window.location.assign(window.location.href);

#1


85  

No jQuery is necessary in this situation.

没有jQuery是必要的,这种情况下。

window.opener.location.reload(false);

https://developer.mozilla.org/en-US/docs/Web/API/Window

https://developer.mozilla.org/en-US/docs/Web/API/Window

#2


18  

You can use window.opener, window.parent, or window.top to reference the window in question. From there, you just call the reload method (e.g.: window.parent.location.reload()).

您可以使用window.opener,window.parent,或window.top引用窗口的问题。从那里,你只需要调用重载方法(例如:window.parent.location.reload())。

However, as a caveat, you might have problems with window.opener if you need to navigate away from the originally opened page since the reference will be lost.

但是,作为一个警告,你可能会,如果你需要从最初打开页面导航离去,因为参考将会丢失与window.opener问题。

#3


5  

parent.location.reload();

This should work.

这应该工作。

#4


2  

You can reload parent window location using :

您可以使用以下命令重新加载父窗口位置

window.opener.location.href = window.opener.location.href;

#5


1  

  top.frames.location.reload(false);

#6


0  

Prevents previous data from been resubmitted. Tested in Firefox and Safari.

防止重新提交先前的数据。在Firefox和Safari中测试过。

top.frames.location.href = top.frames.location.href;

#7


0  

window.parent.opener.location.reload();

worked for me.

为我工作。

#8


0  

This working for me:

这对我有用:

  window.opener.location.reload()
  window.close();

In this case Current tab will close and parent tab will refresh.

在这种情况下,当前选项卡将关闭,父选项卡将刷新。

#9


0  

this will work

这将工作

window.location.assign(window.location.href);