Summary JS implementation of the page refresh and jump

Source: Internet
Author: User

Refresh parent page iframe using IFRAME, pop-up child page
Parent.location.reload ();

Eject Sub-page
Window.opener.location.reload ();--This method is what I have tried, can successfully achieve the function I want, the other has not tried, cannot guarantee absolutely correct.


child window refreshes parent window

Self.window.opener.locaction.reload ();


Refreshes an open () method window that opens

Window.opener.location.href = Window.opener.location.href


Refreshes the window opened in the Winodw.showmodeldialog () method

Window.parent.dialogArguments.document.execCommand (' Refresh ');

Or
Response.Write ("<script>window.location.href = window.location.href</script>");

Refresh this page Response.Write ("<script>window.location.href=window.location.href; </script> ");

Refresh the parent page and this page:

Response.Write ("<script>alert (' Submit success! ');window.location.href=window.location.href;window.opener.location=window.opener.location;</script> ");

use JS to achieve page jump mode :

The first type :

<script language= "javascript" type= "Text/javascript" >

window.location.href= "Login.jsp?backurl=" +WINDOW.LOCATION.HREF;

</script>

The second type:

<script language= "JavaScript" >

Alert ("return");

Window.history.back (-1);

</script>

The third type:

<script language= "JavaScript" >

Window.navigate ("top.jsp");

</script>

The fourth type:

<script language= "JavaScript" >

self.location= ' top.htm ';

</script>

The fifth type:

<script language= "JavaScript" >

Alert ("Illegal access! ");

top.location= ' xx.jsp ';

</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.