js window.open()实现打印,如何在关闭打印窗口时刷新父窗口
var childWin = window.open("your URL"); //获取子窗口句柄
childWin.onunload = function(){ //onunload是窗口关闭事件
this.opener.location.reload(); //childWin.opener为父窗口,及时刷新
}
楼主也可以这样:(直接在子窗口中)
window.onunload = function(){
this.opener.location.reload();
}
更为简洁。。。
js window.open()实现打印,如何在关闭打印窗口时刷新父窗口的更多相关文章
- JS实现关闭当前子窗口,刷新父窗口
一.JS实现关闭当前子窗口,刷新父窗口 JS代码如下: <script> function refreshParent() { window.opener.location.href = ...
- JS实现关闭当前子窗口,刷新父窗口及调用父窗口的方法
一.js实现关闭当前子窗口,刷新父窗口 JS代码如下: <script> function refreshParent() { window.opener.location.href = ...
- 更新记录后关闭子窗口并刷新父窗口的Javascript
有时我们需要在新打开的窗口里面编辑信息,等编辑完了,需要将当前窗口关闭并且刷新父窗口,以使修改生效,本文就是介绍用 javascript 来实现"更新记录后关闭子窗口并刷新父窗口" ...
- 关闭open页面时刷新父页面列表
var winObjEI = window.open("/Invoice/InvoiceViewEI?invoiceid=" + data.InvoiceId); ; //关闭op ...
- layer.js关闭子窗口及刷新父窗口
在需要layer.js弹窗口时,当编辑完窗口内容,需要关闭及刷新父窗口时: $("#senddata").click(function(){var id = $('input[na ...
- js关闭子窗口,刷新父窗口
父页面js:function btnAdd_onclick() {window.open("xxx.jsp", "","height=600, wid ...
- web 打开子窗口提交数据或其他操作后 关闭子窗口且刷新父窗口实现
父页面 : html连接:<a href="javascript:void(0)" onclick="window.open(子页面URL)">js ...
- layer关闭当前窗口并刷新父窗口
window.parent.location.reload(); var index = parent.layer.getFrameIndex(window.name); parent.layer.c ...
- window.open窗口关闭后刷新父窗口代码
window.open窗口关闭后刷新父窗口代码 window.opener.location.href=window.opener.location.href;window.close();
随机推荐
- iOS 使用SDwebImage缓存图片并在断网时候显示
[_loadImageView setShowActivityIndicatorView:YES]; [_loadImageView setIndicatorStyle:UIActivityI ...
- Effective Java 01 Consider static factory methods instead of constructors
Advantage Unlike constructors, they have names. (BigInteger.probablePrime vs BigInteger(int, int, Ra ...
- linux 查看系统版本
博客分类: linux LinuxRedHatDebianSuSE 几种查看linux版本信息的方法: uname -a cat /proc/version cat /etc/issue lsb_r ...
- MVC如何在单独的类库中添加区域
今天要做一个将区域放到单独的类库中的程序,其实就是多加几个引用的问题,但是我比较喜欢这种设计结构,因为这样的话可以把单独的应用逻辑放在单独的类库中处理,项目看起来更清晰分明,所以写了这个随笔. 首先创 ...
- Solr 参考资料
solr 的入门好资料 https://cwiki.apache.org/confluence/display/solr/Apache+Solr+Reference+Guide https://two ...
- Windows Server 2012 R2 IIS8.5+PHP(FastCGI)+MySQL环境搭建教程
准备篇 一.环境说明: 操作系统:Windows Server 2012 R2 PHP版本:php 5.5.8 MySQL版本:MySQL5.6.15 二.相关软件下载: 1.PHP下载地址: htt ...
- python module getopt usage
import getopt import sys def usage(): print 'this is a usage.' def main(): try: print sys.argv #sys. ...
- [瞎JB写] C++多态
似乎只能通过引用或者指针进行动态多态...蛋疼的语法 #include <iostream> #include <vector> #include <memory> ...
- Ubuntu 14.04(32位)安装Oracle 11g(32位)全过程
1.将系统更新到最新:sudo apt-get updatesudo apt-get dist-upgrade2.安装Oracle所需的依赖包:sudo apt-get install automak ...
- RPC(远程过程调用)的应用
接触背景 因为工作上某项目的需要设计一种分布式处理耗时的运算,每个节点然后将运算结果返回给中心服务器,而最初未了解RPC这部分之前我的设计是在每一个RPC服务器上搭建一个webserver,然后部署运 ...