Window.opener is null in firefox
I have a page that opens a popup as
openWindow(top, 'prcsTypeSelectionPopup?event=prcsTypeSelection', 'lovWindow', {width:750, height:550}, true, 'dialog', pathCallBack);
and the popup has the following code
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();
}
But when the page loads in firefox I get an error like window.opener is null on the second line of the returnselect () function
function returnSelect()
{
window.document.forms[0].choice_processType.value ;
--> window.opener.document.forms[0].pevent.value = 'getprocessName';
Any idea how to overcome this
Thanks in advance...
source to share
You are opening a window from a different domain / subdomain. In this case, you don't have access to the parent window that opened the target window because the security permissions don't allow it.
For example, if you open site2.com from site1.com , then it has an empty key in the target window.
If you open site2.site.com from site1.site.com , it also has no access because they are two different sites. p>
But if you have a site.com page from site.com or a subdomain.site.com page from site.com you have access because security permissions allow it.
Note: The "prcsTypeSelectionPopup? Event = prcsTypeSelection" may be incorrect. Change it to root correct path without domain, for example:
/ prcsTypeSelectionPopup? Event = prcsTypeSelection
source to share