Forum Moderators: open

Message Too Old, No Replies

Calling a JS function from a popup

Calling a JS function in the opener window from the popup

         

kidd

11:36 pm on Sep 2, 2003 (gmt 0)

10+ Year Member



Hello:

I would like to know if I can call a javascript function that is in the opener window from a popup.

Lets say that the window that opens the popup has a JS function called "returnAge();", now I want to call it when a person clicks on a button in the popup window.

I was thinking that maybe this may work:


function callOpenerFunction(){
window.opener.returnAge();
}

Any replies are gratefully received.

THANKS

korkus2000

12:32 am on Sep 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I believe it will work, but I am not sure what your function does. Remember to target the popup with the function return value from the main window. Remember that variables declared on one page are locked in that page and are not global to other pages.

korkus2000

12:48 am on Sep 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Gave it a shot and it worked fine in IE. Passed the opener function a value from the pop-up and did a calculation and then passed the new value back and displayed it in a textbox on the pop-up.

kidd

2:52 pm on Sep 3, 2003 (gmt 0)

10+ Year Member



Thanks for your aswers I did try it and it worked fine.

greetings