JavaScript中的window.opener问题 [英] window.opener issue in javascript
本文介绍了JavaScript中的window.opener问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
当我在asp.net应用程序中使用jquery(jquery.colorbox.js)打开弹出窗口并尝试在以下javascript错误中访问popup(child)页面中的父页面隐藏控件时,生成了
window.opener
是null
还是不是对象
但是当我使用window.open打开弹出窗口时,一切工作正常.
更新父隐藏控件的代码:
Hi
when I open popup by using jquery(jquery.colorbox.js) in asp.net application and trying to access parent page hidden control in popup(child) page below javascript error is generating
window.opener
is null
or not an object
but when I open popup by using window.open then everything is working fine.
code to update parent hidden control:
window.opener.document.getElementById("hdnVal").value = ''value from popup'';
谢谢
thanks
推荐答案
但是当我使用window.open打开弹出窗口时,一切正常.
Window.Open
打开一个新窗口,并且不弹出,因此window.opener
起作用.
阅读有关Window的信息.在此处打开: MSDN:打开方法 [ ^ ]
在此处了解有关ColorBox弹出窗口的信息:颜色驱动:Colorbox [ ^ ]
but when I open popup by using window.open then everything is working fine.
Window.Open
opens a new window and NOT popup and hencewindow.opener
works.
Read about Window.Open here:MSDN: open Method[^]
Read about ColorBox popup here: Color powered: Colorbox[^]
这篇关于JavaScript中的window.opener问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文