admin管理员组文章数量:1323224
Is there a way to reload an entire frameset using Javascript onload() event?
function logout() {
/* ... */
// reload entire frame
top.location.reload();
}
<body onload="logout()">
This cause all frames to reload but the URL of the frame where this was called didn't changed to the URL specified in the framset.
Is there a way to reload an entire frameset using Javascript onload() event?
function logout() {
/* ... */
// reload entire frame
top.location.reload();
}
<body onload="logout()">
This cause all frames to reload but the URL of the frame where this was called didn't changed to the URL specified in the framset.
Share Improve this question edited Sep 20, 2017 at 22:38 P.S. 16.4k14 gold badges65 silver badges86 bronze badges asked Sep 26, 2008 at 9:29 ksuraltaksuralta 17.2k16 gold badges41 silver badges36 bronze badges1 Answer
Reset to default 5As I understood it, you want to reload each frame in a frameset using the original URL as stated in <frame src="...">.
This little function can do that (put it into the document holding the frameset):
this.reloadChildFrames = function()
{
var allFrames = document.getElementsByTagName("frame");
for (var i = 0; i < allFrames.length; i++)
{
var f = allFrames[i];
f.contentDocument.location = f.src;
}
}
You are then able to call that function from within any child frame:
top.reloadChildFrames()
Of course, this can only work when all frames e from the same origin.
本文标签:
版权声明:本文标题:Javascript: How to reload entire frameset onload() event including frame where Javascript is called - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742064891a2418775.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论