Click to See Complete Forum and Search --> : Window-Calling-Problems
I have to windows. A "palette"-window and a "mainwindow"-window. How can i realize it, that I can click into the palette-window and something in the mainwindow will then be done there. Is it possible to call the mainwindow with "window.mainwindow."??? Please help me
khalidali63
12-29-2002, 09:41 AM
If you open pallete window from within the main window then you can get the required functionality.
something like this.
you have a oage opend,
this will be parent
from this winddow you create a pallete window
var pallete = window.open("","pallete","window settings")
once this is done then you can access any variables or event on the pallete window
by making calls like this
pallete.document.onclick=someMethod;
hope this guides you to right direction
Khalid
Charles
12-29-2002, 11:56 AM
Originally posted by Dave Clark
You reference the main window as follows:
top.opener...
Thus, you can call a function in the main window as follows:
top.opener.functionName();
or, you can update a FORM field in the main window as follows:
top.opener.document.formName.fieldName.value = "...";
Dave That will only work when the current window is the top window. Most of the time this is the case, but not always. Use instead window.opener or self.opener. These two mean the same thing.
First off all, thanks,
i only use opener.Function(); and it works. Or is it not good?:o
Charles
12-29-2002, 12:17 PM
JavaScript has a lot of short cuts. What looks like the top level scope is really the window or the self level.opener really means self.opener in the same way that document.write really means window.document.write.
Charles
12-29-2002, 02:14 PM
Yes, I stand corrected. As the topmost frame/window will of necessity, be the one that was opened by the parent it is the one that has the opener object.