JS implementation of the parent page refresh __js

Source: Internet
Author: User

When you do a project, you need to implement one of these features: A window is popped, the window is operated, the window is closed after the operation is completed, and the parent window is refreshed; tangle for a little while. Check the data, and then their own practice, success, the following will I find the information to share it;

With IFRAME, pop-up page refresh the parent page

iframe
   parent.location.reload ();


Pop-up page
   window.opener.location.reload ()--This method is I tried, can successfully achieve the function I want, the other did not try, can not guarantee absolute correctness.


child window refreshes the parent window

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


Refresh one open () method opened window

    window.opener.location.href = window.opener.location.href


Refresh to Winodw.showmodeldialog () Method opens the Window

    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" (' submitted successfully. ');window.location.href=window.location.href;window.opener.location=window.opener.location;</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.