如何重新加载、停止、返回和加载转发一帧?

发布于 2024-09-16 00:31:19 字数 329 浏览 3 评论 0原文

我得到以下信息:

<frameset cols="20%,80%">
<frame src="zone1.htm" id="zone1">
<frame src="http://www.google.com" id="zone2">
</frameset> 

我可以访问 zone1.htm 并且第二个框架是从外部网站加载的,我想使用 javascript:在 zone1.htm 中重新加载 + 停止 + 后退 + 前进控件来控制 google 框架。

我不确定同源政策是否也禁止这样做。

谢谢

I got the following:

<frameset cols="20%,80%">
<frame src="zone1.htm" id="zone1">
<frame src="http://www.google.com" id="zone2">
</frameset> 

I got access to zone1.htm and the second frame is loaded from an external website, i want to do using javascript: Reload + Stop + Back + Forward Controls in zone1.htm to control the google frame.

I'm not sure if this is forbidden too by the same origin policy.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

别忘他 2024-09-23 00:31:19
window.history.forward()
window.history.back();
window.location.reload();

其中 window 是 window 对象。框架的窗口对象可以通过以下方式访问:

frames.zone2.window;

然后使用名称,而不是 ID。或者使用数字索引:
框架[0].窗口;

当今的浏览器通常会限制这些功能作为安全增强功能(您不希望广告始终将您重定向回来)

window.history.forward()
window.history.back();
window.location.reload();

where window is the window object. A frame's window object can be access in this way:

frames.zone2.window;

Use name then, instead of ID. Or use numeric indexes:
frames[0].window;

Today's browser often limit these features as a security enhancement (you don't want an advertisement to redirect you back the whole time)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文