window.opener.location.reload() and href()的区别
来源:互联网 发布:mac打底唇膏 编辑:程序博客网 时间:2024/05/17 08:36
window.opener.location.reload() and href()的区别
Posted on 2010-05-03 18:00 大椰网吧 阅读(3652) 评论(0)编辑 收藏2个方法都是刷新父窗口,但是其中还是有奥妙的哦。
window.opener.location.reload(); 这个方法在强迫父窗口的时候,在有些IE浏览器(比如安全设置高)的情况下,会弹出一个确认对话框,提示是不是要重新再刷新一次页面,这可是比较郁闷的事情哦,我后来把这个方法替换成了window.opener.location.href=window.opener.location.href;
就不会出现那样的问题了。
window.opener其实是指本窗口的父窗口,比如,one.jsp 通过popupwindow打开了two.jsp,哪么在two.jsp里面的window.opener就是指one.jsp,所以在two.jsp里面完全可以用window.opener调用任何一个one.jsp里面的方法,实现one.jsp和two.jsp的交互。
注意:window.opener.location.href只是一个链接,如果想实现父窗口的提交就要调用window.opener.action="" 和window.opener.submit(); 方法,但是不幸的是这段代码在firefox下不能运行,解决的办法为在父窗口中写一个提交的function在子窗口中通过window.opener.functionname()调用。
通常在使用window.opener的时候要去判断父窗口的状态,如果父窗口被关闭或者更新,就会出错,解决办法是加上如下的验证if(window.opener && !window.opener.closed)
- window.opener.location.reload() and href的区别
- (转)window.opener.location.reload() and href的区别
- window.opener.location.reload() and href的区别
- window.opener.location.reload() and href()的区别
- window.opener.location.reload() and href()的区别 弹出页修改后刷新父窗体
- window.opener.location.reload() and href()的区别 弹出页修改后刷新父窗体 .
- window.opener.location.reload() and href()的区别 弹出页修改后刷新父窗体
- window.opener.location.reload()的使用
- window.location.href,window.location.replace(),window.location.reload() 三者的区别
- window.location.href,window.location.replace(),window.location.reload() 三者的区别
- window.location.href,window.location.replace(),window.location.reload() 三者的区别
- window.location.href,window.location.replace(),window.location.reload() 三者的区别
- JavaScript window.opener.location.reload
- window.location.reload()与window.location.href区别
- window.location.Reload()和window.location.href 区别
- window.location.Reload()和window.location.href 区别
- window.location.Reload()和window.location.href 区别
- window.location.Reload()和window.location.href 区别
- u-boot第一阶段start.S分析
- Java JNI的一个笔记
- ie下jquery.getJSON的缓存问题的处理方法
- Java synchronized详解
- C#程序设计--输入一个整数,按数字反顺序输出
- window.opener.location.reload() and href()的区别
- boost之Interprocess库,进程间通讯库之condition/mutex/scoped_lock
- 电脑ping权限的设置
- window mysql的sql文件到linux下执行,中文乱码
- web开发中文数据写入到数据库乱码问题
- iOS Client 与WebSocket 通信(一)
- jQuery源码学习
- Java中channel的应用总结
- mpi中利用自定义归约操作实现merge