JS parent page opens child page background close refresh parent page window

Source: Internet
Author: User

I checked a lot of articles on disabling subpages to refresh the parent page on the Internet, but it is not clear why it is not suitable for my project.

In the test of a piece of code, it is found that this is suitable for me.

1. Create a function refresh () on the parent page ()

Function refresh () {window. Location. Reload ();}

Parent page refresh Method

2. Use the window. OPEN function to open the child page on the parent page.

3. Use the following method to close the processed data in the background of the child page and refresh the parent page.

String JavaScript = string. format ("<script language = JavaScript> window. opener. refresh (); window. focus (); window. opener = NULL; window. close (); </SCRIPT> "); page. registerstartupscript ("", JavaScript); return;

Subpage: closes the subpage in the background and refreshes the parent page.

The window. opener. Refresh (); Method refresh () is used to call the function refresh () method on the parent page"

In this way, the parent page can be refreshed successfully.

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.