|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
i would like to pass a value to a function in another frame, and thought that this could be accomplished by
parent.otherframe.functionName(value); but that doesn't work, can anyone tell me how i can do this? |
|
#2
|
|||
|
|||
|
Not enough information (what is the function supposed to do?) But try to pass the focus to the frame. That is:
focus('parent.otherframe'); parent.othername.functionName(value); |
|
#3
|
|||
|
|||
|
The fact is that a function has its own execution context. This means that the function will look for the variable in it's own frame. Of course it will not find it there. Therefore the way to do it is:
parent.frameName.functionName(parent.otherFrameName.value); If you have any questions about this feel free to e-mail me. ------------------ Ramon Litjens Boradoli Web Design (www.boradoli.nl) |
|
#4
|
|||
|
|||
|
I like keeping functions in one frame as if it were a library. I just declare the variable `var variableName...` and that makes them global, so I haven't had to use the frame-path. The function does execute in the environment of the frame it is in, NOT the frame that calls it, so it's often useful to pass other objects to the function, such as forms. That way you can still manipulate things in the calling frame.
|
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > calling function in different frame |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|