window.opener -- Access Denied

D

David Cohen

From the main window, I'm opening a popup window.

In that poupup window, the user loads a number of different pages (by
submitting forms and clicking on buttons), some of which are in a
different domain. But eventually, the user comes back to a page that is
in the same domain as the page in the main window.

On this page, I'm trying to execute the following script:

<script language="JavaScript" type="text/javascript">
window.opener.document.forms[0].action="otherpage.asp";
window.opener.document.forms[0].submit();
window.opener.close();
</script>

Yes, there is a form on the page that has been sitting in the main
window this whole time.

However, I'm getting an "access denied" error. Any thoughts?

Thanks,
David
 
L

Lee Harvey

Several things may be going on:

- First and foremost, are both pages being hosted by the same domain?
- Unless the window.opener window was actually opened using a window.open()
command, then the following will not work: window.opener.close();
- Finally, check the scripting security preferences of your browser.

L8R

| From the main window, I'm opening a popup window.
|
| In that poupup window, the user loads a number of different pages (by
| submitting forms and clicking on buttons), some of which are in a
| different domain. But eventually, the user comes back to a page that is
| in the same domain as the page in the main window.
|
| On this page, I'm trying to execute the following script:
|
| <script language="JavaScript" type="text/javascript">
| window.opener.document.forms[0].action="otherpage.asp";
| window.opener.document.forms[0].submit();
| window.opener.close();
| </script>
|
| Yes, there is a form on the page that has been sitting in the main
| window this whole time.
|
| However, I'm getting an "access denied" error. Any thoughts?
|
| Thanks,
| David
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

window.opener in Chrome 15
access denied using mywindow.moveTo() ? 26
window.opener 2
window.opener 2
window.opener with FireFox Issue 3
window.opener 1
window.opener in NN7 1
window.opener lost in postback 4

Members online

Forum statistics

Threads
474,077
Messages
2,570,566
Members
47,202
Latest member
misc.

Latest Threads

Top