JavaScript

Moderators: None (Apply to moderate this forum)
Number of threads: 2058
Number of posts: 5158

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
someone help me please!!!!!!!!!!!!!!!!! Posted by ricktor on 27 Jul 2003 at 1:01 PM
iam trying to using a button and a herf open a small java script function this i have done fine.

Next get the function to change the htm files loaded into two seperate iframes

frame is the name of one and frame 3 the other

each iframe is in a differnt layer on one main page

can some one help me please so stuck

thanx
Report
Re: someone help me please!!!!!!!!!!!!!!!!! Posted by lillu on 28 Jul 2003 at 4:40 AM
Hi,

I'm not sure if this is what you wanted:

An iframe is a layer on its own. I did not quite get how you actually wanted to display these iframes. On top of each other showing one at a time or show both simultaneously?

<html>

<head>

<script language="javascript">
function loadFrames()
{
document.frame2.location.href = "frame2.htm";
document.frame3.location.href = "frame3.htm";
}
</script>

</head>

<body>

<input type="button" onclick="loadFrames()" value="Load Frames">

<br />
<br />

<iframe name="frame2" align="right" width="50%" height=300
src="frame0.htm" frameborder=0>
</iframe>

<iframe name="frame3" align="right" width="50%" height=300
src="frame1.htm" frameborder=0>
</iframe>

</body>

</html>

Lillu






: iam trying to using a button and a herf open a small java script function this i have done fine.
:
: Next get the function to change the htm files loaded into two seperate iframes
:
: frame is the name of one and frame 3 the other
:
: each iframe is in a differnt layer on one main page
:
: can some one help me please so stuck
:
: thanx
:

Report
Re: someone help me please!!!!!!!!!!!!!!!!! Posted by ricktor on 30 Jul 2003 at 7:38 PM
hi thanx so much works a treat except thats for forms on the main page

i used what you said and it worked great but then i looked at what i was doing and it was in the wrong page i put the code in the main page when i realy needed it in a different page,

ill explain more -

i have a main page arguments sake call it index ,index has two iframes in layers it also has buttons i want it so that i click a button on index and it loads a htm page into one of the iframes say frame1 then that html page has choices of links all which change the contens of frame1 and the second frame aswell its complicated

to sum up the link to change the frames contents and the second frmae is coming from a page loaded into one of the frames in the main page

does this make sence i hope so thanx for all your help

rick
Report
Re: someone help me please!!!!!!!!!!!!!!!!! Posted by StannyBoy on 31 Jul 2003 at 12:14 AM
The way to change one iframe's content from another iframe is just

top.document.frame2.location.href = "frame2.htm";

SB


: hi thanx so much works a treat except thats for forms on the main page
:
: i used what you said and it worked great but then i looked at what i was doing and it was in the wrong page i put the code in the main page when i realy needed it in a different page,
:
: ill explain more -
:
: i have a main page arguments sake call it index ,index has two iframes in layers it also has buttons i want it so that i click a button on index and it loads a htm page into one of the iframes say frame1 then that html page has choices of links all which change the contens of frame1 and the second frame aswell its complicated
:
: to sum up the link to change the frames contents and the second frmae is coming from a page loaded into one of the frames in the main page
:
: does this make sence i hope so thanx for all your help
:
: rick
:

Report
Re: someone help me please!!!!!!!!!!!!!!!!! Posted by ricktor on 31 Jul 2003 at 9:05 AM
works great thanx

rick




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.