Home  >  Article  >  Web Front-end  >  Summary of several methods of refreshing the page (JS, ASP.NET)_javascript skills

Summary of several methods of refreshing the page (JS, ASP.NET)_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:05:051309browse

Several ways to refresh the page using Javascript:

1. history.go(0)
2. location.reload()
3. location=location
4. location.assign(location)
5. document.execCommand(' Refresh')
6. window.navigate(location)
7. location.replace(location)
8. document.URL=location.href

How to automatically refresh the page:

1. The page automatically refreshes: add the following code to the area

The 20 means refresh every 20 seconds One page.

2. The page automatically jumps: add the following code to the area


The 20th finger will jump to http after 20 seconds: //jay-xu33.cnblogs.com/page

3. The page automatically refreshes the js version


How ASP.NET outputs the refresh parent window script statement

1. this.response.write("<script>opener.location.reload();</script>");

2. this.response.write("<script>opener.window.location.href = opener.window.location.href;</script>");

3. Response.Write("");


JS script statement to refresh the frame
//How to refresh the page containing the frame


//The child window refreshes the parent window

( or< ;a href="javascript:opener.location.reload()">Refresh )


//How to refresh the page of another frame using

If you want to refresh when the window is closed or refresh when the window is opened, just call the following statement in .

Refresh when opening the window
Refresh when closing the window
< ;script language="javascript">
window.opener.document.location.reload()

Statement:
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