Home > Web Front-end > JS Tutorial > body text

Summary of JS refresh page methods

php中世界最好的语言
Release: 2018-05-22 14:22:05
Original
1278 people have browsed it

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.

Summary of several methods of JS refreshing the current page

  • 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

js Complete page refresh method

  • Automatic page refresh

  • Automatic page jump

  • Page automatically refreshes js version

  • Script statement of JS refresh framework

  • JS related refresh example code

jsMultiple implementation methods to return to the previous page and refresh

  1. <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>
    Copy after login

##Refresh Summary of several methods of the page (JS, ASP.NET)
history.go(0)
location.reload()
location=location
location.assign(location)
document.execCommand(&#39;Refresh&#39;)
window.navigate(location)
location.replace(location)
document.URL=location.href
Copy after login

A link refresh page and js refresh page usage example introduction
a链接刷新页面与js刷新页面用法示例介绍
a链接的使用操作
JS怎么刷新当前页面
location.replace(location.href);
JS刷新框架的脚本语句
Copy after login

javascript implementation code to force refresh the page
<script language="JavaScript"> 
function myrefresh() 
{ 
window.location.reload(); 
} 
setTimeout(&#39;myrefresh()&#39;,1000); //指定1秒刷新一次 
</script>
Copy after login

Js code to refresh the frame page
语句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(&#39;bottom&#39;).location.reload();
语句6. window.parent.bottom.location.reload();
语句7. window.parent[&#39;bottom&#39;].location.reload();
Copy after login

js return to the previous page and refresh code organization
JS 重载页面,本地刷新,返回上一页
JS定时刷新知识点实例
JS刷新框架的脚本语句
子窗口刷新父窗口
如何刷新另一个框架的页面用
Copy after login

JS implementation to reload the current page

Introduces the use of JavaScript to refresh the upper-level page and the current page, with specific example code attached.

Several ways to refresh the interface using js

Sometimes it is necessary to manually call to refresh the interface, such as non-dynamically switched language modes, styles, etc. . This content has compiled simple example code for you.

javascript web page refresh method collection
<body onload="opener.location.reload()"> 开窗时刷新 
<body onUnload="opener.location.reload()"> 关闭时刷新 
<script language="javascript"> 
window.opener.document.location.reload() 
</script>
Copy after login

JS implementation of updating web page content without flickering

A brief analysis of other pages in the JS refresh frame&& Summary of JS refresh window methods

Summary of JS ASP. NET and other methods to implement page and window refresh in different environments.

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!

Recommended reading:

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!