动态框架创建

发布于 2024-09-03 06:34:19 字数 147 浏览 2 评论 0原文

我有一个网页,正常,没有模糊或奇怪的东西。当用户单击给定链接时,我想将该页面捕获在 html 框架内。

问题是我不想重新加载页面。某种动态 DOM 技巧似乎是可行的方法,但在我的测试中没有效果。

如果有人有任何想法那就太好了!

谢谢

I have a web page, normal no fuzz or weird stuff. And I want to trap that page inside an html frame when a user clicks on a given link.

The thing is i don't want to reload the page. Some kind of dynamic DOM trickery seems the way to go, but to no avail in my tests.

If anyone has any ideas it would be great!

Thanks

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

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

发布评论

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

评论(2

时光沙漏 2024-09-10 06:34:19

我认为如果不重新加载就无法完成此操作,至少不能理智地完成。

也许可以将完整的 DOM 树移动到 IFRAME 中新创建的空文档中,但是很糟糕!这听起来非常昂贵,会导致任何电影/动画和其他内容重新加载,并且您仍然被外部文档困住,您需要删除所有元素,以便仅保留 IFRAME 或 FRAME。然后,在移动 DOM 时,您可能会遇到浏览器特定的怪癖,等等……

我真的会重新加载。

I don't think this can be done without a reload, at least not sanely.

It may be possible to move a complete DOM tree into a newly created, empty document within an IFRAME, but yuck! it sounds horribly expensive, will cause any Movies / animations and other things to reload, and you're still stuck with the outside document, where you need to remove all the elements so only the IFRAME or FRAME remains. Then you may encounter browser specific quirks when moving the DOM, and on and on....

I would really go with a reload.

忆梦 2024-09-10 06:34:19

我能想到的唯一其他解决方案(未测试)是已经拥有框架结构,其中一些框架的大小为 0。
当用户单击链接时,您只需调整框架的大小。

这有道理吗?

The only other solution I can think of (not tested) is to already have the frame structure, with some of the frames with size 0.
When the user clicks on the link you just resize the frames.

Does this make sense?

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