We sometimes load the page, there will be a cache file on the performance of the current file is disturbed, such as some cached style files will be the page effect changes, then we want the page to be loaded with the automatic refresh of the cache file.
However, since the jump page will definitely use the content of the window object in the BOM section to change the current window, it is almost impossible to control the window's load count, since each new window produces all variables and object contents will be erased. At this time you can consider whether you can get the page jump load when the original page came from different information and make judgments to control the window is to continue to jump or stop jump. At this point, you can use the Window.location.search property.
Location.search can get the original page from the parameter information, the specific code control is actually very simple, my original page is demo.html, the following code:
<script> if (window.location.search.indexOf ("?") <0) {//Determine if the first load alert (window.location.search); Window.location.href= "demo.html?1"; } else{} //second load empty operation </script>
This is useful at some point, although it is extremely simple.
JavaScript implementation automatically refreshes once the page is loaded and clears the cache file