I remember in Xing ' an internship to be positive, I led a symbolic give me a set of test questions, there are JS closures and page refresh and other topics. Today, a long time ago, one of the test topics, JS page Refresh method and the page automatically refresh jump and return to the previous page and the next page and other methods summarized, for your reference only!
One, the JavaScript page refreshes the overloaded method:
<a Href="Javascript:location.reload ();">Click Reload Page</a><a Href="Javascript:history.go (0);">Click Reload Page</a><a Href="Javascript:location=location;">Click Reload Page</a><a Href="JAVASCRIPT:LOCATION=LOCATION.HREF;">Click Reload Page</a><a Href="Javascript:location.replace (location);">Click Reload Page</a><a Href="Javascript:location.replace (location.href);">Click Reload Page</a><a Href="Javascript:location.assign (location);">Click Reload Page</a><a Href="Javascript:location.assign (location.href);">Click Reload Page</a><!--//The following only Internet Explorer---<a href="javascript:document. Url=location.href; " > Click Reload page </a><a href="javascript:navigate (location);" > Click Reload page </a><a href="Javascript:document.execCommand (' Refresh '); " > Click Reload Page </a><!--//above support IE --
Second, the HTML link re-loading method
<!--// 以下不支持ie --><a href="">点击重新载入页面</a><!--// 以上不支持ie --><a href="页面本身">点击重新载入页面</a>
Third, the method of automatically refresh the page
<meta http-equiv="refresh" content="20"> //代码放在head中,每隔20秒钟刷新一次<meta http-equiv="refresh" content="20;url=http://www.haorooms.com"> //20秒之后页面跳转到haorooms中,通常运用到404页面//js自动刷新function myrefresh(){ window.location.reload();}setTimeout(‘myrefresh()‘,1000); //指定1秒刷新一次
Iii. ways to return to the previous and next pages
history.go(-1)//返回上一页(括号中写-2代表返回上两页)history.back()//返回上一页window.history.forward() //返回下一页
JavaScript front page Refresh reload and history, for the time being think so much! There are other ways, small friends can leave a message Ah! Communicate together!
Html-javascript method Rollup for front-end page refresh overloads