Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calling function from window

Status
Not open for further replies.

theEclipse

Programmer
Dec 27, 1999
1,190
US
I am writing a small game which uses an external window to input data.&nbsp;&nbsp;the window scripts fine, but when I try to activate a function in the main window, it gives me an error.<br><br>I thought that the syntax would be:<br><br>parent.document.functionName(Parameters);<br><br>but that syntax gives me an error.<br><br>thanks for any help <p>theEclipse<br><a href=mailto:eclipse_web@hotmail.com>eclipse_web@hotmail.com</a><br><a href=robacarp.webjump.com>robacarp.webjump.com</a><br>**-Trying to build a documentation of a Javascript DOM, crossbrowser, of course. E-mail me if you know of any little known events and/or methods, etc.
 
Try this:<br><br>opener.parent.document.functionName(Parameters);<br><br>the OPENER refers to the window that opened the window you want to call the function from.&nbsp;&nbsp;So if the function is in the main window, and from the main window you open a popup or whatever, you can refer to the main window by calling it 'opener'.<br><br>Hope this solves your problem.<br><br>Jason<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top