JS Page Jump Finishing

Source: Internet
Author: User

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?
    1. <mce:script type=text/javascript><!--  
    2.    
    3. if   ( typeof  swfobject ==  "undefined" )  {   
    4. document.write ( Span class= "string" > ' <SCR '  +  ' ipt type= ' text/ JavaScript " src="/scripts/swfobject-1.5.js "></scr '  +  ' ipt> ' );}   
    5. // --></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?
    1. <mce:script language= " JavaScript " ><!--  
    2.    
    3. Function myrefresh ()    
    4. {   
    5.        window.location.reload ();    
    6. }   
    7. setTimeout ( ' Myrefresh () ' ,   //specify 1 seconds to refresh     
    8. // --></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?
    1. <body onload= " Opener.location.reload () " >  Refresh     when window is opened;
    2. <body  onunload= "Opener.location.reload ()" >  refresh when off    
    3.   
    4. <mce:script language= "javascript" ><!--  
    5.     
    6. window.opener.document.location.reload ()    
    7. //&NBSP;--></MCE:SCRIPT>   

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.