JavaScript child window refreshes the parent window program code

Source: Internet
Author: User

The HTM code is as follows

The code is as follows Copy Code

"<body>
<a href=htm onclick= "window.open (' htm ')" >new</a>
</body>

The HTM code is as follows

The code is as follows Copy Code

"<body>
<a href=# onclick= "opener.location.href= ' http://www.111cn.net '; Window.close ()" >nbn</a>
</body>

The following summary of several JS Refresh parent window

To refresh the parent page IFrame with an IFRAME and popup page

The code is as follows Copy Code

JS Code

<script language=javascript>
Parent.location.reload ();
</script>

JS Code

<script language=javascript>
Parent.location.reload ();
</script>

<script language=javascript>
Parent.location.reload ();
</script>

Popup child page

The code is as follows Copy Code

JS Code

<script language=javascript>
Window.opener.location.reload ();
</script>

JS Code

<script language=javascript>
Window.opener.location.reload ();
</script>
<script language=javascript>
Window.opener.location.reload ();
</script>

child window refreshes parent window

The code is as follows Copy Code

JS Code

<script language=javascript>
Self.opener.location.reload ();
</script>

JS Code

<script language=javascript>
Self.opener.location.reload ();
</script>

<script language=javascript>
Self.opener.location.reload ();
</script>

Refreshing a window opened with the open () method

The code is as follows Copy Code

JS Code

<script language=javascript>
Window.opener.location.href=window.opener.location.href;
</script>

JS Code

<script language=javascript>
Window.opener.location.href=window.opener.location.href;
</script>

<script language=javascript>
Window.opener.location.href=window.opener.location.href;
</script>

Refreshing a window opened with the Winodw.showmodeldialog () method

The code is as follows Copy Code

Java code

<script language= "JavaScript" >
Window.parent.dialogArguments.document.execCommand (' Refresh ');
</script>

To capture this value, the parent window adds the return value to the open () event described in story one

  code is as follows copy code

<script language=" JavaScript "
  function open ()
     {
         var str=window.showmodaldialog ("Page C");
         if (str!=null)  
         {             
            Picobj.innerhtml+=str;
         
       }
    }
</script>

Related Article

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.