[英]How to hide a bootstrap modal on the previous page if user comes in clicking BACK?
I have a website that queries a large database. 我有一个查询大型数据库的网站。 It takes a while (3-10 sec) to generate a page.
生成页面需要一段时间(3-10秒)。 This is no problem for users, but I want to show a friendly message instead of the user just sitting in front of a page that is not changing.
对于用户而言,这没有问题,但是我想显示一个友好的消息,而不是让用户只是坐在没有变化的页面前。 So what I did is I show a bootstrap modal saying "Please wait, we're loading your page" when a user clicks any particular link.
所以我要做的是当用户单击任何特定链接时显示一个引导模式,说“请稍等,我们正在加载您的页面”。 That works well.
那很好。 The modal is shown on the page, and when the server has generated the new page, it will open and the modal clearly disappears.
该模式显示在页面上,并且服务器生成新页面后,它将打开,并且模式明显消失。
The problem is when the user navigates to another link (again seeing the modal on the page), and then moves back. 问题是当用户导航到另一个链接(再次在页面上看到模式)时,然后移回。 The previous modal is now shown.
现在显示以前的模态。 See overview below:
请参阅下面的概述:
How to fix this? 如何解决这个问题?
Set this header 设置此标题
header("Cache-Control: private, must-revalidate,
max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0"
);
Also see: How to Defeat the Browser Back Button Cache 另请参阅: 如何击败浏览器后退按钮缓存
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.