f5 - 仅刷新框架

发布于 2024-10-08 00:39:40 字数 121 浏览 0 评论 0原文

是否可以只刷新窗口中的一帧而不刷新所有帧? 我的问题是我有一个页面index.php,里面有两个框架 - 菜单和内容。当用户单击刷新(f5)时,index.php 已再次加载,并且内容页面为空白。

我能做些什么?

Is it possible to refresh only one frame in the windows and not all the frames?
My problem is that i have a page index.php and inside there are two frames - menu and content. when the user clicks on refresh(f5) the index.php has been loaded again and the content page is blank.

What can i do?

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

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

发布评论

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

评论(2

甜心 2024-10-15 00:39:41

如果您熟悉javascript在页面刷新中的用法。你可以尝试用传统的 html 来代替它。

javascript:location.reload(false)

将从缓存中重新加载页面。将其设置为您的内容页面,对于菜单页面,您可以设置它。

javascript:location.reload(true)

If you are familiar with javascript's usage in page refresh. You can try that instead of traditional html do a job.

javascript:location.reload(false)

will do a page reload from the cache. Set this to your content page and for menu page you can set this.

javascript:location.reload(true)
夏末染殇 2024-10-15 00:39:41

您可以做的是将用户选择的最后一个页面存储在cookie中(使用客户端代码),然后在页面加载中(再次客户端)检查该cookie,如果存在,则默认加载该页面而不是显示空白页面。

使用 jQuery 访问 cookie 变得非常简单: http://plugins.jquery.com/project/Cookie

What you can do is store the last page selected by the user in cookie (using client side code) then in the page load even (client side again) check for that cookie and if exists, load that page by default instead of showing blank page.

Using jQuery accessing cookies becomes really simple: http://plugins.jquery.com/project/Cookie

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