Hi,
I have a main window that calls a pop-up window. I want to be able to reference a javascript function in the main window from the popup. Is this doable?
Thanks!
Thanks, but I was mistaken. The function that calls the function we need to reference is in a .js file--not a popup window. Is it still able to be referenced?
/* I want to be able to reference a javascript function in the main window from the popup. Is this doable? */
Yes, it is possible if you're opening a file that already already exists, such as blah.html, with window.open().
From the child window, you can call a function such as parentWindowFunction() from the parent by using something like this in the child and using the "opener" property:
self.opener.parentWindowFunction();
This works in IE6 and Opera 7, I haven't tested it with any other browsers.
...........................................
I've been trying to figure out how to create script in a new window that is written on the fly but not having much luck. So, I'm opening an existing window that already contains the script.
For every problem, there's a solution and every solution brings it's own set of problems.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.