Javascript 从另一帧刷新另一帧。查询
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6981349/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Refresh other frame, from another frame. Jquery
提问by Oliver 'Oli' Jensen
Is it possible to reload the page, where the user came from or, even better, reload the frame the user came from, if it matches an URL?
是否可以重新加载用户来自哪里的页面,或者更好的是,如果它与 URL 匹配,则重新加载用户来自的框架?
I have a link. The user clicks it, and it opens in a new window, a new url. A form will run in that new window. What I want, is a function to reload the first window (Where the user came from)
我有一个链接。用户点击它,它会在一个新窗口中打开,一个新的 url。一个表单将在该新窗口中运行。我想要的是一个重新加载第一个窗口的函数(用户来自哪里)
Is that possible?
那可能吗?
回答by Gasim
Alright. Here is what you do (just an example, tested, works):
好吧。这是你要做的(只是一个例子,经过测试,有效):
test.html
测试.html
<frameset cols="50%, 50%">
<frame name="f1" src="frame1.html">
<frame name="f2" src="frame2.html">
</frameset>
frame1.html
框架1.html
<input type="button" name="test" value="Refresh" onclick="parent.f2.location.reload()">
frame2.html
框架2.html
<span>Hello World</span>
variable parent
is the parent of the current frame.
变量parent
是当前帧的父级。
Read this page. its really helpful
阅读本页。它真的很有帮助
Hope that helps
希望有帮助
回答by Satyajit
How about loading the hyperlink url in the same page and redirect the user to the parent page after the form update is done.
如何在同一页面中加载超链接 url 并在表单更新完成后将用户重定向到父页面。
回答by tmaximini
I think it is not possible if you open another windowIt would however be possible if you just use some kind of overlaying frame like jqmodal
我认为如果你打开另一个窗口是不可能的但是如果你只是使用某种像jqmodal这样的叠加框架是可能的
the README should give you the necessary instructions: http://dev.iceburg.net/jquery/jqModal/README
自述文件应该给你必要的说明:http: //dev.iceburg.net/jquery/jqModal/README