按特定顺序加载 HTML 框架而不会出现后退按钮问题?
我有一个使用框架集的网页。
由于脚本和对象依赖性,我需要按特定顺序加载帧。
我使用这个例子作为模板: JavaScript 来源:导航:框架加载顺序
这会加载一个空页面代替我需要最后加载的页面,然后在加载第一页后将其替换为正确的页面。
但是:我还需要使用浏览器的后退按钮。 如果您在上面的链接中运行示例,让两个框架都加载,然后单击“后退”按钮,顶部框架将恢复到临时空白页。 然后需要再次单击“后退”按钮以导航到框架集之前的页面。
有没有办法强制框架按特定顺序加载,而无需此“后退”按钮行为 - 或者强制“后退”按钮跳过空白页面?
这需要与 Internet Explorer 6 和 7 配合使用,最好也与 Firefox 3 配合使用。
I have a web page that uses a frameset.
Due to scripting and object dependencies, I need to load the frames in a specific order.
I have used this example as a template:
The JavaScript Source: Navigation: Frames Load Order
This loads an empty page in place of the page I need to load last, then replaces it with the correct page after the first page has loaded.
However: I also need to use the browser Back button. If you run the sample at the above link, let both frames load, then click the Back button, the top frame reverts to the temporary blank page. It is then necessary to click the Back button again to navigate to the page before the frameset.
Is there a way to force frames to load in a specific order without this Back button behavior - or a way to force the Back button to skip the empty page?
This needs to work with Internet Explorer 6 and 7 and preferably with Firefox 3 as well.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你在这篇文章中多次提到这一点......
如果您正在开发遗留系统,那么我认为您是时候接受框架集在浏览器后退按钮方面的行为方式了。 如果它确实是一个遗留系统,则不需要修复此行为。 如果它实际上不是遗留系统并且您需要解决这个问题,那么您需要摆脱使用框架集。 HTML 标准已弃用框架集,不应使用。
You mention this quite a lot in this post...
If you are working on a legacy system, then I think it is time you accepted how framesets behave in terms of the browser's back button. If it is truly a legacy system, you don't need to fix this behaviour. If it is actually NOT a legacy system and you need to fix this problem, you need to get away from using a frameset. Framesets were deprecated from the HTML standards and shouldn't be used.
为什么不按所需的顺序使用三个 iframe,然后调整它们的大小/将它们移动到适当的位置?
Why not use three iframes in the desired order, then resize/move them to the appropriate places?
使用 JavaScript 构建框架本身:
Build the frames themselves using JavaScript: