Advanced JavaScript Question - IE - Permission denied Error 
Author Message
 Advanced JavaScript Question - IE - Permission denied Error

consider this situation

Window A opens a new Window B.

B can access window A's href by window.opener.location.href

However if you change the page ( go to some other page in window A),
then calling window.opener.location.href from window B will have "permission
denied error".

Is there anyway we can check that the window A's location has changed ?

thanks in advance,
kaushik



Sun, 28 Sep 2003 23:14:25 GMT  
 Advanced JavaScript Question - IE - Permission denied Error
In window A's onunload event (assuming window B is still open and valid), reset window B's opener
property to null.  Window B should then always test it's window.opener property for != null before
attempting to access window.opener.location.href.

--
Michael Harris
Microsoft.MVP.Scripting
--

Please do not email questions - post them to the newsgroup instead.
--


consider this situation

Window A opens a new Window B.

B can access window A's href by window.opener.location.href

However if you change the page ( go to some other page in window A),
then calling window.opener.location.href from window B will have "permission
denied error".

Is there anyway we can check that the window A's location has changed ?

thanks in advance,
kaushik



Mon, 29 Sep 2003 04:29:15 GMT  
 Advanced JavaScript Question - IE - Permission denied Error
Actually, the answer was posted on this group and it helped me out a lot.
Here it is again:

try
{
    var strURL;
    strURL = window.opener.location.href;
    return true;

Quote:
}

catch (errorCaught)
{
    // exception handling code.
    alert('The parent browser window has navigated away from the parent
window. The submission will not be done. This pop-up window will now
close.');
    window.close();

Quote:
}

-- Bert Szoghy
INSI Strategic Technologies
Ottawa


Quote:
> In window A's onunload event (assuming window B is still open and valid),

reset window B's opener
Quote:
> property to null.  Window B should then always test it's window.opener

property for != null before
Quote:
> attempting to access window.opener.location.href.

> --
> Michael Harris
> Microsoft.MVP.Scripting
> --

> Please do not email questions - post them to the newsgroup instead.
> --



> consider this situation

> Window A opens a new Window B.

> B can access window A's href by window.opener.location.href

> However if you change the page ( go to some other page in window A),
> then calling window.opener.location.href from window B will have
"permission
> denied error".

> Is there anyway we can check that the window A's location has changed ?

> thanks in advance,
> kaushik



Tue, 30 Sep 2003 03:29:27 GMT  
 Advanced JavaScript Question - IE - Permission denied Error
And the solution assumes a relatively up-level browser that supports try/catch...  For IE that's 5.0
or higher (actually JScript 5.0 or higher)...

--
Michael Harris
Microsoft.MVP.Scripting
--

Please do not email questions - post them to the newsgroup instead.
--


Quote:
> Actually, the answer was posted on this group and it helped me out a lot.
> Here it is again:

> try
> {
>     var strURL;
>     strURL = window.opener.location.href;
>     return true;
> }

> catch (errorCaught)
> {
>     // exception handling code.
>     alert('The parent browser window has navigated away from the parent
> window. The submission will not be done. This pop-up window will now
> close.');
>     window.close();
> }

> -- Bert Szoghy
> INSI Strategic Technologies
> Ottawa



> > In window A's onunload event (assuming window B is still open and valid),
> reset window B's opener
> > property to null.  Window B should then always test it's window.opener
> property for != null before
> > attempting to access window.opener.location.href.

> > --
> > Michael Harris
> > Microsoft.MVP.Scripting
> > --

> > Please do not email questions - post them to the newsgroup instead.
> > --



> > consider this situation

> > Window A opens a new Window B.

> > B can access window A's href by window.opener.location.href

> > However if you change the page ( go to some other page in window A),
> > then calling window.opener.location.href from window B will have
> "permission
> > denied error".

> > Is there anyway we can check that the window A's location has changed ?

> > thanks in advance,
> > kaushik



Tue, 30 Sep 2003 10:10:35 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. "Permission Denied Error" in IE 6.0

2. Why error Error: Permission denied code 800A0046 on line 20 char 5

3. error 70: permission denied for MsgBox

4. Permission denied error

5. Permission denied error in cross frame

6. Handling permission denied errors

7. "Permission denied" Error

8. permission denied error when trying to call send method of NewMail object

9. Permission denied error in opener.function_name()

10. deleting files with file system object ( Permission denied error )

11. Permission denied error when scheduling task thru vbscript

12. Permissions denied error

 

 
Powered by phpBB® Forum Software