JS implements the method of refreshing the parent page without a prompt box. js page

Source: Internet
Author: User
Tags close page

JS implements the method of refreshing the parent page without a prompt box. js page

This example describes how to refresh the parent page without a prompt box. We will share this with you for your reference. The details are as follows:

Page A opens page B. When page B is saved as A class, you need to close page B. When page B is refreshed, A prompt box is displayed, requesting A retry, this is an unexpected situation with poor user experience.

There are two solutions:

1. Page A is very simple (without frame/iframe)

In function on page B:

Function close () {window. opener. location. reload (); window. opener = null; window. open ('', '_ self'); window. close ();}

You can.

2. The elements of page A are A bit complex and contain frames:

Requirement: If you want to refresh page A on page B

Directly call the function on page A in the function on page B. Take the most common "A" as the list page, and "B" as the new page:

There is A query button on page A to check all the lists. We will trigger this function on page B:

Function close () {window. opener. queryAll (); // queryAll () is the query function window. close ();} of page ();}

Note that if frame A on the same page jumps to frameB, instead of using opener, it uses parent.

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.