防止在 Firefox 中隐藏时重新加载 iframe 内容

发布于 2024-07-27 11:55:30 字数 215 浏览 1 评论 0原文

在我的网络应用程序中,我使用 jquery hide() 函数隐藏 iframe。 令人惊讶的是,当 iframe 隐藏时,firefox 会重新加载 iframe 的内容。 这是一个已知问题吗? 有解决方法吗? 我还尝试隐藏 iframe 设置 css 样式显示为“无”。 相同的结果。

该剧本按照歌剧的预期运作。

我使用的是火狐浏览器 3.5.1

In my webapplication I hide an iframe using jquery hide() function.
Surprisingly firefox reload the content of iframe when the iframe is hidden.
Is this a known problem? Is there a workaround?
I also tried to hide the iframe setting css style display to 'none'. Same result.

The script work as expected in opera.

I'm using firefox 3.5.1

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

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

发布评论

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

评论(2

难理解 2024-08-03 11:55:30

有人说解决方案可能是提供不同的
每个 IFRAME 的 id 或 name 属性 =
但它在我的情况下不起作用(FF 3.6+)

另一个可能的解决方案是确保 iframe 的内容
不是从浏览器缓存中获取的。

这可以通过将随机字符串连接到 iframe 的源 URL 来完成,确保内容永远不会来自缓存。

总而言之,这是一个应该由 Mozilla 团队修复的错误!..

Some say the solution might be in providing a different
id or name attribute for each IFRAME =
but it did not work in my Case (FF 3.6+)

Another possible solution is to make sure the iframe's content
is not taken from the browsers cache.

this can be done by concatenating a randomizing string to the the iframe's source URL, making sure the content will never come from the cache.

all in all, its a bug that should be fixed by the Mozilla team!..

比忠 2024-08-03 11:55:30

不知道这个错误,但一种可能的解决方案是将高度和宽度设置为 0px,也许?

Don't know about that bug, but one possible solution is to set height and width to 0px instead, maybe?

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