HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 15th, 2000, 06:28 PM
evilsizord evilsizord is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 1999
Location: St. Louis, MO, USA
Posts: 1 evilsizord User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to evilsizord
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?

Reply With Quote
  #2  
Old February 21st, 2000, 08:18 PM
Carles J Grau Carles J Grau is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2000
Location: SPAIN
Posts: 3 Carles J Grau User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation 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);

Reply With Quote
  #3  
Old February 26th, 2000, 06:51 AM
Ramon Ramon is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 1999
Location: Helden,Limburg,The Netherlands
Posts: 33 Ramon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
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)

Reply With Quote
  #4  
Old April 3rd, 2000, 12:57 PM
underdog underdog is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Location: British Columbia
Posts: 11 underdog User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation 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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > calling function in different frame


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

IBM developerWorks




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway