我有一个页面,打开弹出窗口为
openWindow(top, 'prcsTypeSelectionPopup?event=prcsTypeSelection', 'lovWindow', {width:750, height:550}, true, 'dialog', pathCallBack);
弹出窗口有以下代码
function returnSelect()
{
window.document.forms[0].choice_processType.value ;
window.opener.document.forms[0].pevent.value = 'getprocessName';
window.opener.document.forms[0].processName.value='';
for (var i=0; i < document.forms[0].elements.length; i++)
{
if (document.forms[0].elements[i].checked)
{
window.opener.document.forms[0].processName.value=document.forms[0].elements[i].value;
break;
}
}
if(window.opener.document.forms[0].processName.value=='') {
window.opener.document.forms[0].lovProcessType.value = '';
window.opener.document.forms[0].pevent.value = '';
}
window.opener.document.forms[0].submit();
closeConn();
}
function closeConn()
{
self.close();
}
但是当页面在 Firefox 中加载时,我收到错误
returnselect() 函数的第二行 window.opener 为 null
function returnSelect()
{
window.document.forms[0].choice_processType.value ;
--> window.opener.document.forms[0].pevent.value = 'getprocessName';
知道如何克服这个问题
提前致谢...
您从另一个域/子域打开一个窗口。在这种情况下,您无权访问打开目标窗口的父窗口,因为安全权限不允许这样做。
-
例如,如果您打开一个页面site2.com从一页site1.com目标窗口有它的开启者null.
-
如果您打开一个页面site2.site.com从一页site1.site.com— 也无法访问,因为这是两个不同的站点。
-
但如果你的一页site.com页自页site.com或一页子域名.site.com从页面site.com— 您拥有访问权限,因为安全权限允许。
注意:“prcsTypeSelectionPopup?event=prcsTypeSelection”可能不正确。将其更改为不带域的 root 正确路径,示例:
/prcsTypeSelectionPopup?event=prcsTypeSelection
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)