JavaScript refreshes the page in several ways:
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
Ways to automatically refresh pages:
1. Page Automatic refresh: Add the following code to the <meta http-equiv= "Refresh" content= ">"
20 of which means that the page is refreshed every 20 seconds.
2. Page Automatic Jump: Add the following code to the
<meta http-equiv= "Refresh" content= "20;url=http://jay-xu33.cnblogs.com/" >
20 of which refers to 20 seconds after the jump to the http://jay-xu33.cnblogs.com/page
3. Page automatically refresh JS version
<script language= "JavaScript" >
function Myrefresh ()
{
Window.location.reload ();
}
SetTimeout (' Myrefresh () ', 1000); Specify 1 seconds to refresh once
</script>
Asp. NET how to output refresh the 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 ("<script language=javascript>opener.window.navigate (" You want to refresh the page. asp ');</script> ");
JS Refresh Frame Script statement
How to refresh the page that contains the frame with
<script language=javascript>
Parent.location.reload ();
</script>
child window refreshes parent window
<script language=javascript>
Self.opener.location.reload ();
</script>
(or <a href= "javascript:opener.location.reload ()" > Refresh </a>)
How to refresh another frame's page with
<script language=javascript>
Parent. Another FrameID.location.reload ();
</script>
If you want to close the window or refresh when you want to open windows, call the following statement in <body>.
<body onload= "Opener.location.reload ()" > Refresh when opening windows
<body onunload= "Opener.location.reload ()" > Refresh when closing windows
<script language= "JavaScript" >
Window.opener.document.location.reload ()
</script>