It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

Linking two separate iframes from two different webpages

Linking two separate iframes from two different webpages

Postby ruchir123 on Sun Mar 01, 2009 10:57 pm

I dont know how can I explain this. But I will try my best by putting entire issue in series of steps below.


Step 1: I have a web page with two <div> tags located besides each other. We will call them the right <div> and the left <div>

Step 2: Left <div> has a drop down list that dynamically generates navigation as shown in the code below.
<form style="margin-left:3%; margin-bottom:1%" action="" method="post">
<SELECT ONCHANGE="if (window.frames && window.frames.iframes) {
window.frames.iframes.location.href =
this.options[this.selectedIndex].value;
}">
<OPTION VALUE="Swimming.html">Swimming
<OPTION VALUE="TaxServices.html">Tax Services
<OPTION VALUE="TravelLeisure.html">Travel & Leisure
<OPTION VALUE="ymca.html">Waste Management
<OPTION VALUE="WaterManagement.html">Water Management
<OPTION VALUE="Welding.html">Welding
</SELECT>
<iframe id="theFrame" name="iframes" src="murrieta.html" align="top" style="margin-top:7%;height:95%; width:100%;"></iframe>
</form>

Step 3: To explain step 2 better, For e.g. if option "Swimming" is selected from the option group on left <div>, it will launch its child links in
in the iframe nam as "iframes"

Step 4: The option "Swimming" has an html file associated with it called "Swimming.html" This file has three links as mentioned below

<ul>
<li><a href="http://www.google.com" id="l14">about us</a></li>
<li><a href="murrietainfo2.html" id="l15">services</a></li>
<li><a href="murrietainfo3.html" id="l16">pricing</a></li>
<li><a href="murrietainfo4.html" id="l17">contacts</a></li>
</ul>

Step 5: To explain step 4 better, if "Swimming" option is selected, it will launch four links in iframe region

Step 6: NOW IT GETS REAL TRICKEY

Step 7: My Requirement is : say if user clicks "about us" link for "Swimming" option in left <div> tag, it should lauch "www.google.com" in
the iframe of right <div>. Say, if use selects "services" link for "Swimming" option in left <div> tag, it should launch "murrietainfo2.html"
in the iframe of right <div>


Step 8: i need to do this for all of options, as all of options in option list has child links that will be dropped in the left div iframe


PLEASE PLEASE HELP

Thanks,
Ruchir
ruchir123
 
Posts: 3
Joined: Sun Mar 01, 2009 10:53 pm

Re: Linking two separate iframes from two different webpages

Postby Etheryte on Sun Mar 01, 2009 11:01 pm

Your iframe should have a name assigned:

<iframe name=right_iframe>
</iframe>

and your link should target that name

<a href="http://www.yahoo.com" target="right_iframe">

Try that.
Image
User avatar
Etheryte
250+ Club
 
Posts: 255
Joined: Sun Mar 16, 2008 12:21 pm

Re: Linking two separate iframes from two different webpages

Postby ruchir123 on Sun Mar 01, 2009 11:04 pm

Etheryte wrote:Your iframe should have a name assigned:

<iframe name=right_iframe>
</iframe>

and your link should target that name

<a href="http://www.yahoo.com" target="right_iframe">

Try that.


will this work, even if the link and iframe both are in two separate webpages (under same folder)?
ruchir123
 
Posts: 3
Joined: Sun Mar 01, 2009 10:53 pm

Re: Linking two separate iframes from two different webpages

Postby Etheryte on Mon Mar 02, 2009 5:26 am

What do you mean? I don't think I quite understand. Iframe renders the page only temporary, it doesn't copy it into code permanently.
Image
User avatar
Etheryte
250+ Club
 
Posts: 255
Joined: Sun Mar 16, 2008 12:21 pm


Who is online

Users browsing this forum: No registered users and 7 guests