referencing variable in one frame from another

liunx

Guest
Hello,<br />
Hopefully this is an easy question with a simple answer. I have a frameset with a top, right, bottom, and left frame all surrounding a "main" frame in the middle. What I would like to do is keep a counter variable on one of the outside frames so that in the "onLoad" event of the main frame I can check that counter and depending on its value load one .htm file or another. But I'm not sure how to reference a variable in another frame from the "main" frame (or how to increment it once I've got it). <br />
<br />
If this is not doable, is there a way I can pass a parameter into the frameset when I call it and then use that parameter to determine which .htm file to load?<br />
<br />
Thanks!<!--content-->declare a javascript variable in the page that has all the framset code then you can access that variable from any of the children frames<br />
<br />
parent.variableName<br />
<br />
to access a variable decalred in a frame<br />
<br />
parent.frameName.variableName<!--content-->thanks Khalid. What you said works, but I guess I didn't explain my problem properly. What I'm doing is when they click on a button on the top frame I am loading an .htm file into the 'main' frame'. On that .htm file is an "OK" button and when they click that I want to load another file into the 'main' frame. But the problem is that the first .htm file is not part of the frameset. So what I was doing was just reloading the frameset. The variable I declare in the frameset gets reset every time it gets loaded I guess, so I can't increment it. Is there a way to pass a parameter to the frameset when I load it?<!--content-->i hav a big problem with my site! i created my site in dreamweaver at a screan res of 800*600 but when i take my site onto a computer with a different res then my banner shortens(its set as a background image, noresize) and my background image for my main frame tiles(which is a logo with a grey background). how do i stop this from happening?:confused:<!--content-->In any element that you have a background image that you don't want to tile, (eg. <body> or <table>), add this:<br />
<br />
<body style="background-image:url('123.gif');background-repeat:no-repeat;"><!--content-->lavalamp! please can i email my page to you and you can look at my coding and tell me whats wrong with it so that it will stop doing this?<!--content-->Yeah, you can feel free to e-mail me, but make sure that it has got lavalamp somewhere in the subject, otherwise I'll just delete it as junkmail.<br />
<br />
If the web-site is online though you could just post a URL, and if it isn't online then you could just zip it and add it to a post as an attachment.<!--content-->
 
Back
Top