Solved

Javascript opener window error

Posted on 2008-10-16
6
852 Views
Last Modified: 2012-05-05
Hello all...

I am ripping out my hair with this.  I need to do a window.opener.runMyfunction(); and pass variables to a parent. I keep getting this error and I don't understand why.

Unsafe JavaScript attempt to access frame with URL https://www.somesite.com/consultants/party_booking.php?action=edit&evtid=129ecb11-f891-8f1b-5934-48f75ed114b5&osCsid=b2oheur9k68d62i8kig1uauu0klgb46f from frame with URL https://www.somesite.com/consultants/selphp.html. Domains, protocols and ports must match.

Both pages are over SSL, both on the same domain, both in the same path... Why is this thing bugging out??

The function is defined on the party_booking.php page and the popup is calling "window.opener.theFunction('sid', 'name'); " and getting this error.  I can't figure where the heck I am going wrong.

In the end I need this to work on FF3.x, IE, and Safari... but I don't see this as so complex.
BTW... It runs just fine when everything is on localhost.

Thanks!  -Cheers, Peter.
0
Comment
Question by:ein_mann_betrieb
  • 3
  • 3
6 Comments
 
LVL 11

Expert Comment

by:flipz
ID: 22734191
Call you post the window.open code? Could it have to do with one file being php while the other html? Can you try creating a php version of the selphp.html file and call that one to see if that works?
0
 
LVL 5

Author Comment

by:ein_mann_betrieb
ID: 22734533
Hi flipz,
  popupRefSel is called from a button on the parent page.  That opens a pop-up window where there are multiple entries and select buttons.  When a select button is pressed "window.opener.doSelect("some sid", "some name");" is called.  This is where the error is registered.  The selphp.html was for testing purposes... the live code (as shown in the commented line below) is a php page with a different GET string.  But this didn't work and I was using the html page just for testing to save constantly running soap queries on my select window.

Thanks!  -Cheers, Peter.

  function popupRefSel() {
    window.open('selphp.html','popupRefSel','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=500,height=500,screenX=150,screenY=150,top=150,left=150')
//    window.open('party_booking.php?action=refsel','popupRefSel','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=500,height=500,screenX=150,screenY=150,top=150,left=150')
  }
 
  function doSelect(sid, snme){
alert(sid);
	document.party_form.referred.value = sid;
	document.party_form.referred_name.value = snme;
  }

Open in new window

0
 
LVL 11

Expert Comment

by:flipz
ID: 22734816
Which browser(s)/versions are you getting this error in? all of them?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Author Comment

by:ein_mann_betrieb
ID: 22734844
I have FF 3.x and Safari for testing... I only have third hand info on IE 7.
And Yes the errors occur on both.

Thanks.  -Cheers, Peter.
0
 
LVL 11

Assisted Solution

by:flipz
flipz earned 250 total points
ID: 22735043
Everything that I can find on this issue points to browser bugs. Haven't found any potential fixes yet - you can try a wild guess here. Call the window.open using an absolute path such as:

window.open('/consultants/selphp.html');

I'll post any more thoughts.... if I have any!
0
 
LVL 5

Accepted Solution

by:
ein_mann_betrieb earned 0 total points
ID: 22736770
Flipz,
   Yea... tried that and it didn't work.

I am trying to set the values right from the window.  It didn't work in the beginning, but it seems to work now.  Here is what I am using:
  window.opener.document.party_form.referred_name.value = snme;
  window.opener.document.party_form.referred.value = sid;

I just don't understand why this didn't work to begin with...
Arg.  -Cheers, Peter.
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Worldmap 1 28
Link not working 6 42
Triple line in an alert message 4 21
null, truthy, falsey confusion 25 29
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question