Solved

Javascript opener window error

Posted on 2008-10-16
6
849 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
Comment Utility
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
Comment Utility
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
Comment Utility
Which browser(s)/versions are you getting this error in? all of them?
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 5

Author Comment

by:ein_mann_betrieb
Comment Utility
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
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now