简体   繁体   English

chrome后退按钮单击刷新站点

[英]chrome back button click refresh the site

i creating a site online university course registration form but. 我创建了一个网站在线大学课程注册表格,但是。 i want, when someone use my site if he can click back button or next button in chrome or any browser then site take auto refresh . 我想,当某人使用我的网站时,如果他可以单击Chrome中的“后退”按钮或“下一步”按钮或任何浏览器,则该网站将自动刷新。 Please tell me how that possible. 请告诉我那怎么可能。

To make sure the response contents aren't cached, you should add a Cache-Control: max-age=0 header to the response, which marks it as uncachable. 为确保不缓存响应内容,应在响应中添加Cache-Control: max-age=0标头,将其标记为不可缓存。 There are some caveats in that area, but googling on "no cache headers" will make that clear for you. 在该区域中有一些警告,但是对“没有缓存头”进行谷歌搜索将使您清楚。

To make sure the browser doesn't cache the form values (whether or not the response was cached), you should disable autocomplete on the form: 为确保浏览器不缓存表单值(是否缓存了响应),应在表单上禁用自动完成功能:

 <form ... autocomplete="off">
      ...
 </form>

One step further is to investigate the browser's "history API", which you can hook into using libraries such as Backbone.History . 进一步的步骤是研究浏览器的“历史API”,您可以使用Backbone.History之类的库将其连接。

add this in font page it can refresh page 在字体页面中添加它可以刷新页面

header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
?>

if you use check box then you need to add 如果使用复选框,则需要添加

    <form ... autocomplete="off">
      ...
 </form>

this can clear your check box tick. 这可以清除您的复选框打勾。 so if you click back button in mojila or chrome your page will be auto refresh. 因此,如果您单击Mojila或Chrome中的“后退”按钮,则页面将自动刷新。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM