window.opener.location.reload() and href的区别
来源:互联网 发布:百安居建材 知乎 编辑:程序博客网 时间:2024/04/30 16:09
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 区别
- AJAX技术简介及入门实例[收藏]
- 一行代码解决框架iframe木马
- 关闭窗口弹出设为首页或加入收藏对话框
- 表格技巧汇总
- Window.Open参数详解
- window.opener.location.reload() and href的区别
- flex 下拉树的实现
- 三种简洁的Tab导航(网页选项卡)简析
- ExtJs 中文信息在firefox中字体偏小的解决方法
- 软件人才缺制约中国软件业发展
- JavaScript密码强度检测
- SQL Server开发过程中的十种常见问题总结(1)
- SQL Server开发过程中的十种常见问题总结(2)
- JS OO程式学习笔记