Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 网页过期时自动重新加载网页_Javascript_Php_Html - Fatal编程技术网

Javascript 网页过期时自动重新加载网页

Javascript 网页过期时自动重新加载网页,javascript,php,html,Javascript,Php,Html,我有一个HTML页面,其标题如下: <meta http-equiv="cache-control" content="no-cache" /> <meta http-equiv="cache-control" content="max-age=0" /> <meta http-equiv="expires" content="Wed, 07 Oct 202

我有一个HTML页面,其标题如下:

<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="expires" content="Wed, 07 Oct 2020 09:50:03 -0600" />
<meta http-equiv="pragma" content="no-cache" />
当前是该日期的04:45:17,我希望该页面在09:50:03自动重新加载,此时该页面将在met标记中有一个新的过期日期,并且我希望该页面根据新日期重新加载


我可以每隔一段时间重新加载,如果磁盘上的任何文件发生更改,我可以使用JavaScript重新加载,但我不知道如何根据expires头重新加载。首选PHP或JavaScript解决方案。

这就是您想要的吗

const expireheader=document.querySelectormeta[http equiv='expires'].getAttribute'content'; console.logexpiresHeader;
这就是你要找的吗

const expireheader=document.querySelectormeta[http equiv='expires'].getAttribute'content'; console.logexpiresHeader;
已经给出了进一步扩展现有答案的答案:

const expireheader=document.querySelectormeta[http equiv='expires'].getAttribute'content'; 让myinterval=new DateexpiresHeader.getTime-new Date.getTime; console.logMyInterval:,myinterval; setIntervalfunction{refreshpage;},myinterval; 刷新页面==>{ window.location.reloadtrue; };
已经给出了进一步扩展现有答案的答案:

const expireheader=document.querySelectormeta[http equiv='expires'].getAttribute'content'; 让myinterval=new DateexpiresHeader.getTime-new Date.getTime; console.logMyInterval:,myinterval; setIntervalfunction{refreshpage;},myinterval; 刷新页面==>{ window.location.reloadtrue; };
你是说这个元数据不会导致页面重新加载吗?可能需要对您的问题进行更多的解释。您是否希望根据时间的内容进行刷新?您是否说此元数据不会导致页面重新加载?可能需要对您的问题进行更多的解释。是否希望根据时间的内容刷新