JS Way page Jump 1.window.location.href way <script language= "javascript" type= "Text/javascript" > Win Dow.location.href= "Target.aspx"; </script>
2.window.navigate Way Jump <script language= "JavaScript" > Window.navigate ("target.aspx"); </script>
3.window.loction.replace Way to achieve page jump, note the difference with the first way <script language= "JavaScript" > Window.location.replace ("target.aspx"); </script> has 3 JSP pages (1.aspx, 2.aspx, 3.aspx), into the system default is 1.aspx, when I enter 2.aspx, 2.aspx inside with Window.location.replace ("3. aspx ");
With the use of Window.location.href ("3.aspx");
There is no difference from the user interface, but when the 3.aspx page has a "back" button, call Window.history.go (-1); Wondow.history.back () method, a little bit of this return button will return to the 2.aspx page, the difference is out, when using Window.location.replace ("3.aspx"); On the 3.aspx page, call Window.history.go ( -1) in the 3.aspx page, Wondow.history.back (), and the method is not good enough to return to 1.aspx.
4.self.location Way to achieve page jump, and the following top.location have a little difference <script language= "JavaScript" > self.location= ' ta Rget.aspx '; </script>
5.top.location <script language= "JavaScript" > top.location= ' target.aspx '; </script>
6. Do not recommend this way to jump <script language= "JavaScript" > Alert ("Return"); Window.history.back (-1); </script>
Meta-mode implementation jump (Content = 3 units is seconds) <meta Http-equiv=refresh content=3; Url= "Http://www.dayanmei.com" >
Summary two:
1. Javascript returns to previous page History.go (-1), returns two pages: History.go (-2);
2. History.back ().
3. Window.history.forward () return to next page
4. Window.history.go (return to page or use the URL you have visited)
Example: <a href= "Javascript:history.go (-1);" > Up one page </a>
Response. Write ("<script language=javascript>") response. Write ("if (!confirm (' Complete task? ')") {History.back ();} ") Response. Write ("</script>") response. Write ("<script language=javascript>history.go ( -1);</script>") <a href= "Javascript:history.go (-1);" > Up one page </a>
Page Jump: onclick= "window.location.href= ' list.aspx '"
P.s. Little Tricks (JS reference js):
[JavaScript]View Plaincopyprint?
- <mce:script type=text/javascript><!--
-
- if ( typeof swfobject == "undefined" ) {
- document.write ( Span class= "string" > ' <SCR ' + ' ipt type= ' text/ JavaScript " src="/scripts/swfobject-1.5.js "></scr ' + ' ipt> ' );}
- // --></mce:script>
<textarea style="display: none;" class="javascript" cols="50" rows="8" name="code"><mce:script type=text/javascript><!--if (typeof swfobject = = "undefined") {document.write (' <scr ' + ') IPT type= "Text/javascript" src= "/scripts/swfobject-1.5.js" ></scr ' + ' ipt> ');} --></mce:script></textarea> Several ways JavaScript refreshes the page: 1 history.go (0) 2 location.reload () 3 location=location 4 Location.assign (lo cation) 5 Document.execcommand (' Refresh ') 6 window.navigate (location) 7 Location.replace (location) 8 document. Url=location.href
ways to automatically refresh pages: 1. Automatic page refresh: Add the following code to the 3. Page automatically refresh JS version
[C-sharp]View Plaincopyprint?
- <mce:script language= " JavaScript " ><!--
-
- Function myrefresh ()
- {
- window.location.reload ();
- }
- setTimeout ( ' Myrefresh () ' , //specify 1 seconds to refresh
- // --></mce:script>
<textarea style="display: none;" class="c-sharp" cols="50" rows="8" name="code"><mce:script language= "JavaScript" ><!--function Myrefresh () {window.location.reload ();} setTimeout (' Myrefresh () ', 1000); Specify 1 seconds to refresh//--></mce:script></textarea>
ASP. NET how to Output Flush 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 Framework Script statement
How to refresh the page containing 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>
Call the following statement in <body> if you want to refresh the window or refresh it when you want to open it.
[JavaScript]View Plaincopyprint?
- <body onload= " Opener.location.reload () " > Refresh when window is opened;
- <body onunload= "Opener.location.reload ()" > refresh when off
-
- <mce:script language= "javascript" ><!--
-
- window.opener.document.location.reload ()
- //&NBSP;--></MCE:SCRIPT>