Solved

Javascript opener window error

Posted on 2008-10-16
6
850 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…

831 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