2013-04-27 53 views
0

我試圖清除我的網站緩存時按下某個按鈕。我在if語句中放置了以下內容,但是我一直陷入無限循環。不知道爲什麼?以下是我在if語句中迴應的內容:強制清除網站緩存

echo "<meta http-equiv=\"refresh\" content=\"0; mywebsitetest.org/ \" />"; 
echo "<meta http-equiv=\"pragma\" content=\"no-cache\">"; 
echo "<script type=" . "text/javascript" . ">"; 
echo "window.location.replace('mywebsitetest.org') </script>"; 

在此先感謝。

+0

你的意思是,打印這些字符串造成無限循環? – doniyor 2013-04-27 19:49:33

+0

爲什麼循環瀏覽它,而不是隻在滿足條件時回顯一次? – Vector 2013-04-27 19:50:14

+0

因爲回聲那些字符串,頁面卡在一個無限循環 – Jay 2013-04-27 19:51:06

回答

3
<meta http-equiv="refresh" content="0; mywebsitetest.org/ " /> 

在0秒內刷新頁面。

window.location.replace('mywebsitetest.org') 

也刷新加載頁面。

如果您的條件在重新加載後仍然存在,您將陷入無限的清爽循環。

+0

對不起,我是個白癡。讚賞。 – Jay 2013-04-27 19:53:35