@CharlesJan 20.2005 — #Sort of. In JavaScript functions are really properties of some Object. If it the property of a different window then you will have to invoke it thusly:
@7studJan 20.2005 — #Can a function be defined in a browser window and the used in another winow?[/quote] Yes. It's done all the time with frames and popup windows. You just have precede the function name with a reference to the other window. With popups, it's pretty straight forward. window.open() returns a reference to the popup, so javascript in the main page can do something like this:
main.htm --------
var popup_win = window.open('somepage.htm', ....);
popup_win.function_in_popup_page();
Javascript in the popup page can reference functions in the main page like this:
popup
somepage.htm ------------
opener.function_in_main_page();
With frames the reference to the proper window depends on the frame structure. Typically, you will have references like this:
Javascript on a page loaded in one of the frames--calls a function on the main page:
window.parent.somefunc();
Javascript on a page loaded in one of the frames--calls a function on a page loaded in one of the other frames:
@inadazeauthorJan 22.2005 — #I am sorry if I was not clear in asking my two different questions. My first thread, I wanted to know if it was possible to control windows from another window. My second question was if I could create a function in one window that could be accessed from another window. I see how this could be confusing and how the two questions are related, but this is only evident to those who, like yourself, know the answer, which I did not. Now I know.