Click to See Complete Forum and Search --> : Variable sent between frames
jjohnstn
03-06-2003, 05:44 PM
Is there a way to send a Javascript variable from one frame to another? I haev a site that has three frames: leftframe, topframe and contentframe. The topframe among other things displays the title of the content which will appear in contentframe. I would like to assign a variable (pagetitle) in contentframe and have it appear in topframe.
When a link in leftframe is clicked, a new page will be displayed in contentframe (along with a new pagetitle variable), which I would then like displayed in topframe. The topframe may or may not be re-loaded with each new contentframe load.
Sorry if this is a bit wordy, but try as I might I can't figure this out. :confused:
khalidali63
03-06-2003, 05:46 PM
Try this link
http://68.145.35.86/skills/javascripts/frames/ParentChildFramesInteraction.html
Cheers
Khalid
jjohnstn
03-06-2003, 05:57 PM
[QUOTE]Originally posted by khalidali63
[B]Try this link
http://68.145.35.86/skills/javascripts/frames/ParentChildFramesInteraction.html
Khalid,
Thank you, I read your response to a previous poster but this is way overkill for what I'm needing. I did save your script for a future, perhasp more complicated project.
Is there an easier way to pass a single variable?
khalidali63
03-06-2003, 06:01 PM
The scrip shows you how to pass variable amongs frames 1 to many,it should be fairly simple to adapt it for only 2 frames.
Cheers
Khalid
jjohnstn
03-06-2003, 06:45 PM
[QUOTE]Originally posted by khalidali63
[B]The scrip shows you how to pass variable amongs frames 1 to many,it should be fairly simple to adapt it for only 2 frames.
I'm still not getting it. For someone not very familiar with Javascript that is too much code to wade through to understand a simple operation.
I appreciate your replies Khalid, but I need a more simple answer....
khalidali63
03-06-2003, 07:44 PM
Simplest answer is this,follow this syntactical format.
frameame.document.formName.elementName.value = "your variable"
the above syntax will pass the variable to the frame
Khalid