---
title: "JS刷新父窗口的几种方式"
author: "wing123"
date: "2014-09-28T16:54:59Z"
tags: []
categories: ["移动开发"]
slug: "js"
draft: false
lastmod: "2014-09-28T16:54:59Z"
id: 2123454
url: "https://wing123.iteye.com/blog/2123454"
---

浮层内嵌iframe及frame集合窗口，刷新父页面的多种方法

 

&lt;script language=JavaScript&gt;   

   parent.location.reload();   

&lt;/script&gt;  

&lt;script language=JavaScript&gt;

parent.location.reload();

&lt;/script&gt;

弹出子页面

 

&lt;script language=JavaScript&gt;   

   window.opener.location.reload();   

&lt;/script&gt;  

&lt;script language=JavaScript&gt;

window.opener.location.reload();

&lt;/script&gt;

 

子窗口刷新父窗口

 

&lt;script language=JavaScript&gt;   

   self.opener.location.reload();   

&lt;/script&gt;  

&lt;script language=JavaScript&gt;

self.opener.location.reload();

&lt;/script&gt;

 

刷新以open()方法打开的窗口

 

&lt;script language=JavaScript&gt;   

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

&lt;/script&gt;  

&lt;script language=JavaScript&gt;

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

&lt;/script&gt;

 

刷新以winodw.showModelDialog()方法打开的窗口

Java代码

&lt;script language="javascript"&gt;   

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

&lt;/script&gt;