473,507 Members | 8,022 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

window.opener with FireFox Issue

Hi Guys,

I know this is probably an easy one, but I am having issues.
Basically, I have a pop-up (child) that controls the parent window.
Clicking on a link on the child window should redirect the parent.
Unfortunately, I cannot get it to work with FireFox after selecting
more than one option.

Javascript code:
function MM_openBrWindow(theURL,winName,features) {
window.open(theURL,winName,features).focus();
}

function changeParent(theURL) {
if (parentExists())
{
window.opener.location.href = theURL;
}
else
{

MM_openBrWindow(theURL,'myWindow','location=1,stat us=1,scrollbars=1,resizable=1,menubar=1,toolbar=1, width=600,height=500');
}
}

function parentExists() {
if (window.opener && window.opener.open && !window.opener.closed)
return true;
else return false;
}

This works for both Safari and IE 6 & 7, but not for FF 2. After
clicking one link from the child window it redirects the parent
correctly, but after selecting an additional link FF does not work.
After installing FireBug I am getting the error: uncaught exception:
Permission denied to get property Window.open.

Function is called by:
<a href="#" onclick="changeParent('<%#Eval("DetailPageURL") %>');
return false;">Link 1</a>

Any ideas or links for solutions would be appreciated.

Thanks in advance,
Sully
Aug 8 '08 #1
3 4061
On Aug 8, 3:18 pm, Asterix <tollh...@gmail.comwrote:
Hi Guys,

I know this is probably an easy one, but I am having issues.
Basically, I have a pop-up (child) that controls the parent window.
Clicking on a link on the child window should redirect the parent.
Unfortunately, I cannot get it to work with FireFox after selecting
more than one option.
<snap>
I tried your javascript code without ANY changes and
parent body:
<body>
Parent<br/>
<a href="__test11.html" target="_blank">Open child</a>
</body>
child body:
<body>
Child<br/>
<a href="#" onclick="changeParent('__test1.html'); return
false;">test1</a>
<a href="#" onclick="changeParent('__test2.html'); return
false;">test2</a>
</body>
and it works with NO problems even when I open multiple child
windows...

Your error message (if it was copied and pasted) implies that your
code tries to use window.open property, NOT window.open() function.
There is no trace of that in the code you provided...
Aug 8 '08 #2
On Aug 8, 3:18 pm, Asterix <tollh...@gmail.comwrote:
Hi Guys,
<snap>
function changeParent(theURL) {
You ONLY need to call your MM_openBrWindow() function here, because
window.open() with named window is going to change the URL of the
existing window, or will open the new one if it does NOT exist...
<removed unneeded code>
>
MM_openBrWindow(theURL,'myWindow','location=1,stat us=1,scrollbars=1,resizable=1,menubar=1,toolbar=1, width=600,height=500');
</removed unneeded code>
>
}
<snap>
Aug 8 '08 #3
Asterix wrote:
[...]
Javascript code:
function MM_openBrWindow(theURL,winName,features) {
window.open(theURL,winName,features).focus();
}
This function is error-prone, window.open() does not need to return a
reference to Window object, nor does the referred object needs to a
have focus() method. And if the focus() call was omitted, the function
would be completely superfluous.
function changeParent(theURL) {
if (parentExists())
{
window.opener.location.href = theURL;
}
else
{

MM_openBrWindow(theURL,'myWindow','location=1,stat us=1,scrollbars=1,resizable=1,menubar=1,toolbar=1, width=600,height=500');
}
}

function parentExists() {
if (window.opener && window.opener.open && !window.opener.closed)
^^^^^^^^^^^^^^^^^^
return true;
else return false;
That is the equivalent of the equally pointless

if (true)
{
return true;
}
else
{
return false;
}

Use

return (...);

instead. (Parentheses are optional).
}

This works for both Safari and IE 6 & 7, but not for FF 2. After
clicking one link from the child window it redirects the parent
correctly, but after selecting an additional link FF does not work.
After installing FireBug I am getting the error: uncaught exception:
Permission denied to get property Window.open.
Probably the URL of the first link uses a different URI scheme, a different
port, or a different domain. In that case you are not allowed to access the
`open' property of Window objects showing a document with such a URL, and it
makes no sense testing for it here anyway.

Do not use Dreamweaver's built-in script code snippets as they are known to
be of poor quality. That said, do not use Dreamweaver without minimum clue
because you think it can do it better than you -- it cannot.
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8*******************@news.demon.co.uk>
Aug 9 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
15996
by: fogwolf | last post by:
First a basic outline of what I am trying to do: I want to have a page spawn a pop-up when you click "submit" on its form. On this pop-up page there will be another form. When you click "submit"...
2
18390
by: Stefan Sch?rmeli | last post by:
I already read about several problems using firefox and the window.opener property. But obviously it didn't help out. So here is my problem: I got a "Search..." link which opens a new window...
1
5198
by: humbads | last post by:
I am trying to get a popup window to work for editing notes in my application. Here's how I implemented it: The original frame is called ORIGINALFRAME and contains a link like this: <a...
7
2836
by: MrFez | last post by:
Through some investigation it appears that selecting "Every visit to the page" for the IE caching setting "Check for new version of stored pages" causes the window.opener property of child windows...
3
10668
by: alison | last post by:
I am trying to redirect the parent page when the user clicks an html button in an aspx page by using the javascript: window.opener.location.href="EditOrders.aspx"; This works fine on IE for...
4
2490
by: badaczewski | last post by:
The following javascript appears on a popup window. <script language="javascript" type="text/javascript"> function InsertContact(value) { window.opener.CallBackContact(value); window.close();...
5
7509
by: asadhkhan | last post by:
I have the following code which works correctly in IE 6, but in IE 7, Fire Fox 2.0 and Netscape 8 it does not work. I have a main page where a button calls this pop-up and uploads a file once you...
29
3869
Frinavale
by: Frinavale | last post by:
I have 2 FireFox (version 2) browser windows opened. One is the child of the other. When the user is finished with the child window, a method in the parent window is called to refresh a...
0
7105
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7371
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7023
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7479
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5037
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3178
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1534
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.