473,573 Members | 2,833 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Parent Docoument after window.open() - callBack-Access

Hello,

I got a little problem. Seems very simple:

* I want to open a popup window
* Popup-window uses data from its father window.

BUT a parent.window does NOT point to the real parents window.
Alerting parent.window.l ocation.href shows me, I'm at the wrong window
location.

So, how do I get back to my CREATOR window ? (If I am a popup).
By the time I can only fix it by....
1: ... // creation
2: var w = window.open(".. .", "...", "...");
3: w.parentWindow = window;
4: // child code
5: alert(window.pa rentWindow.loca tion.href);

Works, IF child code is executed faster than line 3. Could be realised
with a refreshing timer bit would be anything BUT clean.

What I need is something that is initialized directly through
window.open-Call. I want something like:

4: // child code
5: alert(parent.lo cation.href);

or

5: alert(window.pa rent.location.h ref);
Am I stupid ?

Please help :-)

Regards
Rob
Mar 17 '06 #1
2 19220
Solved!

// child code
alert(window.op ener.location.h ref);

....

I love JS...

Robert Degen schrieb:
Hello,

I got a little problem. Seems very simple:

* I want to open a popup window
* Popup-window uses data from its father window.

BUT a parent.window does NOT point to the real parents window.
Alerting parent.window.l ocation.href shows me, I'm at the wrong window
location.

So, how do I get back to my CREATOR window ? (If I am a popup).
By the time I can only fix it by....
1: ... // creation
2: var w = window.open(".. .", "...", "...");
3: w.parentWindow = window;
4: // child code
5: alert(window.pa rentWindow.loca tion.href);

Works, IF child code is executed faster than line 3. Could be realised
with a refreshing timer bit would be anything BUT clean.

What I need is something that is initialized directly through
window.open-Call. I want something like:

4: // child code
5: alert(parent.lo cation.href);

or

5: alert(window.pa rent.location.h ref);
Am I stupid ?

Please help :-)

Regards
Rob

Mar 17 '06 #2
Robert Degen wrote :
Hello,

I got a little problem. Seems very simple:

* I want to open a popup window
* Popup-window uses data from its father window.

BUT a parent.window does NOT point to the real parents window.
Alerting parent.window.l ocation.href shows me, I'm at the wrong window
location.

So, how do I get back to my CREATOR window ? (If I am a popup).
By the time I can only fix it by....
1: ... // creation
2: var w = window.open(".. .", "...", "...");
The window object reference should be a global variable if you want
parent and child windows to "communicat e", if you want the child window
data to populate the parent window. The window object reference *must*
be a global variable in order to achieve your goal.
3: w.parentWindow = window;

Where do you get this parentWindow property to begin with?
I understand what you're trying to do but you're trying to rewrite a
property (which is called opener) that should be read-only to begin
with. You shouldn't be "playing with" references like that.


4: // child code
5: alert(window.pa rentWindow.loca tion.href);


parentWindow is not a reserved keyword.

Works, IF child code is executed faster than line 3.
That's because you are using MSIE 6 which had a bug to start with; that
same bug was fixed in MSIE 7 beta 2 after reporting that bug. So, your
code won't work in future releases.
Could be realised
with a refreshing timer bit would be anything BUT clean.

Window and document are created asynchronously.
What I need is something that is initialized directly through
window.open-Call. I want something like:

4: // child code
5: alert(parent.lo cation.href);

or

5: alert(window.pa rent.location.h ref);


Gérard
--
remove blah to email me
Mar 17 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3705
by: Dave | last post by:
I see this problem in IE but not Firefox. I have a page that opens a second page as a dialog box. If the Dialog is relaunched from a second instance on the page the Dialog window is reused, the controls are reinitialized but window.opener still refers to the original opener. I have simplified code than demonstrated the problem. This is...
2
7612
by: Richard Bell | last post by:
I'm a bit new to Javascript and am trying to do oNewWin = window.open( ... ); then determine when the contents of oNewWin are completely loaded. I've tried oNewWin.attachEvent( "onload", myfunc);
6
1908
by: news.versatel.de | last post by:
Hello NG, I am using javascript to open a new window like this: printpreview=window.open('printview.php','printprev','width=600,height=600'); The new window has a layer called preview: <div id="preview"></div>
4
22181
by: Davey | last post by:
I have a website which has a popup window (this only opens when the user chooses to open it). In the popup window I have a <select> control which lists a selection of "classes". Each class has a description and a class_id (stored in the value attribute of each option). The user will then select a class from the drop-down list. What I want...
2
9148
by: Patient Guy | last post by:
I have a library of functions representing a filesystem interface (essentially a file selection interface, to be used in opening/reading/writing/closing files). Heavily scripted HTML document #1, very application-like, must include the JS file for this library of functions. One reason is that it must call a function to name a "callback"...
2
23485
by: Raj | last post by:
Hi All, I have a problem with trying to refresh the parent window from child window in order to update data in the parent window. The sequence of events are 1) I click a button in the parent window to open a child window thru javascript window.open 2) I have some functionality in the child window that changes the data
1
11556
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at http://weblogs.asp.net/asmith/archive/2003/09/15/27684.aspx but it was far more complex then I needed. (I got lost trying to figure it all...
4
7847
by: John Kotuby | last post by:
Hello all, I am new to Javascript and have been trying to find an answer to this problem. After searching 3 books and searching postings, I am going to ask this newgroup. I am using a pre-built javascript DatePicker. It uses window.open to display the Calendar and works fine if the user clicks on a link for a specific date. The proper...
3
3692
by: O.B. | last post by:
I have a form that shows another child form using the Show() operation. Since the child is modaless, I would like the option that when I click anywhere on the parent form that the parent form comes in front of the child. I added a callback in the parent form to call BringToFront() when I selected anywhere in the parent form, but it didn't...
9
4549
by: 200dogz | last post by:
Hi guys, I want to have a button which opens up a new window when pressed. <asp:Button ID="Button1" runat="server" Text="Open new window" /> ... Button1.Attributes.Add("OnClick",
0
7781
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7699
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7788
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6421
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5594
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5292
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3733
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2216
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1304
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.