Summary of implementation methods for automatically refresh pages : 1)
<Meta http-equiv = "refresh" content = "10; url = redirected page">
10 indicates refreshing every 10 seconds.
2)
<Script language = ''javascript ''>
Window. Location. Reload (true );
</SCRIPT>
If you need to refresh an IFRAME, replace the window with the frame name or ID.
3)
<Script language = ''javascript ''>
Window. navigate ("URL of this page ");
</SCRIPT>
4> Function ABC ()
{
Window. Location. href = "/blog/window. Location. href ";
SetTimeout ("ABC ()", 10000 );
} Refresh this page:
Response. Write ("<script language = JavaScript> window. Location. href = Window. Location. href; </SCRIPT> ") Refresh the parent page:
Response. Write ("<script language = JavaScript> opener. Location. href = opener. Location. href; </SCRIPT> ") Go to the specified page:
Response. Write ("<script language = JavaScript> window. Location. href = 'yourpage. aspx '; </SCRIPT> ") Summary of page refreshing implementation (HTML, ASP, JS)
'By aloxy Timed Refresh:
1, <SCRIPT> setTimeout ("location. href = 'url'", 2000) </SCRIPT> Note: The URL is the URL of the page to be refreshed.
2000 is the waiting time = 2 seconds, 2, <meta name = "refresh" content = "N; URL"> Note:
N is the number of seconds to wait before loading the specified URL.
URL is an absolute URL to be loaded.
N is the waiting time, in seconds.
URL is the URL of the page to be refreshed 3, <% response. Redirect URL %> Note: Generally, you can use a URL parameter or form value to determine whether an operation has occurred, and then use response. Redirect to refresh the operation. 4. Refresh the framework page
<Script language = JavaScript> top. leftfrm. Location. Reload (); parent. frmtop. Location. Reload (); </SCRIPT> 〉 Refresh after the window pops up
Response. Write ("<SCRIPT> window. showmodaldialog ('../OA/spcl. aspx', window, 'dialogheight: 300px; dialogwidth: 427px; dialogtop: 200px; dialogleft: 133px ') </SCRIPT> "); // open
Response. Write ("<SCRIPT> document. Location = Document. Location; </SCRIPT> ");
Add <base target = "_ Self"/> Add the refreshed content to If (! Ispostback) Refresh the left side on the right side of the frame page
// Refresh the left half of the Framework page
Response. Write ("<script language = JavaScript> ");
Response. Write ("parent. Left. Location. href = 'paydetailmanage _ left. aspx '");
Response. Write ("</SCRIPT> ");
Implementation of the page timed refresh function
There are three methods:
1. Set in HTML:
<Title> XXXXX </title> and add the following line!
Timed Refresh: <meta HTTP-EQUIV = "refresh" content = "10">
10 indicates the refresh interval, in seconds. 2. jsp
<% Response. setheader ("refresh", "1"); %>
Refresh Every second 3. Use javascript:
<Script language = "JavaScript">
SetTimeout ("self. Location. Reload ();", 1000 );
<SCRIPT>
One second
Automatic page Jump:
1. Set in HTML:
<Title> XXXXX </title> and add the following line!
Timed jump and refresh: <meta http-equiv = "refresh" content = "20; url = http: // your own URL">,
Among them, 20 refers to jump to the http: // own URL page every 20 seconds.
Click the button to submit the form and refresh the upper-level window.
Window A opens window B Then, submit data in B to the C window. Last, refresh window. And close window B. Several JavaScript Functions // The first window is automatically closed
<Script language = "JavaScript">
<! --
Function clock () {I = I-1
Document. Title = "this window will be closed automatically after" + I + "seconds! ";
If (I> 0) setTimeout ("clock ();", 1000 );
Else self. Close ();}
VaR I = 2
Clock ();
// -->
</SCRIPT> // The second function to refresh the parent page <Script language = "JavaScript">
Opener. Location. Reload ();
</SCRIPT>
// The third window opens
<Script language = "JavaScript">
Function show (mylink, mytitle, width, height)
{Mailwin = Window. open (mylink, mytitle, 'top = 350, Left = 460, width = '+ width +', Height = '+ height +', scrollbars = no ')}
</SCRIPT> |