Click to See Complete Forum and Search --> : sending values between frames
PeterKay1
03-06-2003, 04:02 PM
hey i have a link:
<a href = "welcome.html" target="mainwin">home</a>
is there any way of attaching a varialbe to this link or can i make some sort of global variable that can be used in both frames??
thanx
khalidali63
03-06-2003, 04:58 PM
This should help you get an idea to solve your problem
http://68.145.35.86/skills/javascripts/frames/ParentChildFramesInteraction.html
Cheers
Khalid
PeterKay1
03-06-2003, 05:49 PM
i have seen examples using ? after url's
eg
www.mypage.com/home.html?data
i think this would the best way to solve my prob but how to i use the "data" on the home page??
thankyou
khalidali63
03-06-2003, 05:49 PM
Ok in that case take a look at the link below
http://68.145.35.86/skills/javascripts/DemoForwardFormDataViaURL.html
Cheers
Khalid
PeterKay1
03-06-2003, 06:28 PM
i still dont understand that?
i'm not sure how to use the data in the location bar in the new window.
thatx again!
joeys1
03-11-2003, 05:38 PM
Hello there.
I have a website which uses the Beatnik Player to add sound to webpages. If you haven't heard of Beatnik, don't ask about it right now, as the owners of it are transferring it to open source.
Anyhows, I had some background music playing, and a mute button to control turning the music on or off. This worked on any page on my site.
Basically, I had a hidden frame called (funnily enough) hidden, which was defined in my frameset page, which went something like this:
<frameset cols="*,100%" frameborder="NO" border="0" framespacing="0">
<frame name="hidden" src="hidden.htm">
<frame name="mainFrame" src="index.html">
</frameset>
<noframes><body bgcolor="#FFFFFF" text="#000000">
In hidden.htm, I defined a variable called muteIt, which was initially set to false (mute is off), and in any other page which was loaded into the mainFrame frame, there was a script which went like this:
onMouseDown="parent.hidden.muteIt=!parent.hidden.muteIt"
To explain:
the parent in this case is the frameset script page (ie what created the frames), hidden is the name of the frame whose attributes we wish to access, and muteIt is the javascript variable we want to change.
By naming the frames in the frameset tags, you can use parent.framename.variable to access any variable in any page of any frame.
Joseph.
P.S. If you know about Beatnik, and want to see what I have done, go to http://joeys1..orcon.net.nz/sonified/frames.htm