#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 1999
    Location
    St. Louis, MO, USA
    Posts
    1
    Rep Power
    0
    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. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Location
    SPAIN
    Posts
    3
    Rep Power
    0
    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);
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 1999
    Location
    Helden,Limburg,The Netherlands
    Posts
    33
    Rep Power
    15
    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)
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    British Columbia
    Posts
    11
    Rep Power
    0
    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.

Similar Threads

  1. Calling a JavaScript function from VBScript
    By starbar in forum JavaScript Development
    Replies: 3
    Last Post: February 7th, 2004, 04:31 PM
  2. Calling a function that is inside a differend class
    By Skull-Splitter in forum C Programming
    Replies: 3
    Last Post: January 31st, 2004, 07:39 AM
  3. Calling function and getting weird results
    By sohyueleong in forum C Programming
    Replies: 3
    Last Post: December 9th, 2003, 01:10 PM
  4. Cronjob madness
    By eliteboo in forum Linux Help
    Replies: 10
    Last Post: July 14th, 2003, 10:49 AM
  5. Calling function with multiple return values??
    By bhuether in forum Visual Basic Programming
    Replies: 1
    Last Post: May 14th, 2003, 11:10 AM

IMN logo majestic logo threadwatch logo seochat tools logo