This time I will bring you a summary of JS refresh page methods, what are the precautions for JS refresh page, the following is a practical case, let's take a look.
reload method, this method forces the browser to refresh the current page
replace method, this method replaces the item currently cached in the history (client) by specifying the URL. Therefore, after using the replace method, you cannot access the replaced item through "forward" and "back" URL
Return and refresh the page
Method to automatically refresh the page
Automatic page refresh
Automatic page jump
Page automatically refreshes js version
Script statement of JS refresh framework
JS related refresh example code
<a href="javascript:history.go(-1)" rel="external nofollow" >返回上一页</a> <a href="javascript:location.reload()" rel="external nofollow" >刷新当前页面</a> <a href="javascript:" rel="external nofollow" rel="external nofollow" rel="external nofollow" onclick="history.go(-2); ">返回前两页</a> <a href="javascript:" rel="external nofollow" rel="external nofollow" rel="external nofollow" onclick="self.location=document.referrer;">返回上一页并刷新</a> <a href="javascript:" rel="external nofollow" rel="external nofollow" rel="external nofollow" onclick="history.back(); ">返回上一页</a>
history.go(0) location.reload() location=location location.assign(location) document.execCommand('Refresh') window.navigate(location) location.replace(location) document.URL=location.href
a链接刷新页面与js刷新页面用法示例介绍 a链接的使用操作 JS怎么刷新当前页面 location.replace(location.href); JS刷新框架的脚本语句
<script language="JavaScript"> function myrefresh() { window.location.reload(); } setTimeout('myrefresh()',1000); //指定1秒刷新一次 </script>
语句1. window.parent.frames[1].location.reload(); 语句2. window.parent.frames.bottom.location.reload(); 语句3. window.parent.frames["bottom"].location.reload(); 语句4. window.parent.frames.item(1).location.reload(); 语句5. window.parent.frames.item('bottom').location.reload(); 语句6. window.parent.bottom.location.reload(); 语句7. window.parent['bottom'].location.reload();
JS 重载页面,本地刷新,返回上一页 JS定时刷新知识点实例 JS刷新框架的脚本语句 子窗口刷新父窗口 如何刷新另一个框架的页面用
<body onload="opener.location.reload()"> 开窗时刷新 <body onUnload="opener.location.reload()"> 关闭时刷新 <script language="javascript"> window.opener.document.location.reload() </script>
String (obtained through ajax), if you still need to run the code, then there must be a problem.
js regular related use case sharing
How to handle repeated data submission after multiple clicks on the vue button
The above is the detailed content of Summary of JS refresh page methods. For more information, please follow other related articles on the PHP Chinese website!