Solved

Javascript opener window error

Posted on 2008-10-16
6
854 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
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

Independent Software Vendors: 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!

Question has a verified solution.

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

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
This article discusses how to create an extensible mechanism for linked drop downs.
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…

726 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