Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Loading different pages in an iframe

Reply
Thread Tools

Loading different pages in an iframe

 
 
Fokke Nauta
Guest
Posts: n/a
 
      04-06-2009
Hi all,

I have a page (main.htm) with a few links. I want each link to open the same
page (index2.htm) which contains an iframe. This is not a problem, but I
want each link to open that page with another iframe loading. So - for
example - the 1st link on main.htm opens index2.htm, which loads
3rdpage_1.htm in the iframe.. The 2nd links on main.htm opens index2.htm as
well, but loading with 3rdpage_2.htm in the iframe. And so on.
Can this be done? And if so, how can I manage this?

Thanks in advance.

With best regards,
Fokke Nauta



 
Reply With Quote
 
 
 
 
dorayme
Guest
Posts: n/a
 
      04-06-2009
In article <>,
"Fokke Nauta" <> wrote:

> Hi all,
>
> I have a page (main.htm) with a few links. I want each link to open the same
> page (index2.htm) which contains an iframe. This is not a problem, but I
> want each link to open that page with another iframe loading. So - for
> example - the 1st link on main.htm opens index2.htm, which loads
> 3rdpage_1.htm in the iframe.. The 2nd links on main.htm opens index2.htm as
> well, but loading with 3rdpage_2.htm in the iframe. And so on.
> Can this be done? And if so, how can I manage this?
>


I doubt it with a straight HTML solution. But it is rather early in the
morning for me. <g>

You could:

1. Have as many index2.htm's as there are links on main.htm.
index2_1.htm, index2_2.htm, index2_3.htm. Each of latter has a different
iFrame content specified.

2. If you control the iFrames, have no index2_1.htm's at all. You put
all the links (that need different iFrame content) on main inside all
the iFrames. That means just the iframe changes, just what you want

--
dorayme
 
Reply With Quote
 
 
 
 
Fokke Nauta
Guest
Posts: n/a
 
      04-07-2009
"dorayme" <> wrote in message
news:doraymeRidThis-...
> In article <>,
> "Fokke Nauta" <> wrote:
>
>> Hi all,
>>
>> I have a page (main.htm) with a few links. I want each link to open the
>> same
>> page (index2.htm) which contains an iframe. This is not a problem, but I
>> want each link to open that page with another iframe loading. So - for
>> example - the 1st link on main.htm opens index2.htm, which loads
>> 3rdpage_1.htm in the iframe.. The 2nd links on main.htm opens index2.htm
>> as
>> well, but loading with 3rdpage_2.htm in the iframe. And so on.
>> Can this be done? And if so, how can I manage this?
>>

>
> I doubt it with a straight HTML solution. But it is rather early in the
> morning for me. <g>


Goodmorning then
Javascript, I guess.

> You could:
>
> 1. Have as many index2.htm's as there are links on main.htm.
> index2_1.htm, index2_2.htm, index2_3.htm. Each of latter has a different
> iFrame content specified.


Yeah, that's the way I am doing this right now.
But I thought there should be a better solution.

> 2. If you control the iFrames, have no index2_1.htm's at all. You put
> all the links (that need different iFrame content) on main inside all
> the iFrames. That means just the iframe changes, just what you want
>


No, I need to have that 2nd page.

> --
> dorayme


Fokke


 
Reply With Quote
 
richard
Guest
Posts: n/a
 
      04-07-2009
On Mon, 6 Apr 2009 19:32:42 +0200, "Fokke Nauta" <>
wrote:

>Hi all,
>
>I have a page (main.htm) with a few links. I want each link to open the same
>page (index2.htm) which contains an iframe. This is not a problem, but I
>want each link to open that page with another iframe loading. So - for
>example - the 1st link on main.htm opens index2.htm, which loads
>3rdpage_1.htm in the iframe.. The 2nd links on main.htm opens index2.htm as
>well, but loading with 3rdpage_2.htm in the iframe. And so on.
>Can this be done? And if so, how can I manage this?
>
>Thanks in advance.
>
>With best regards,
>Fokke Nauta
>
>


I think I understand what you are looking for.

The trick is, in your links. If you have one iframe and want each link
to open a seperate page inside it, then all you do is change the
"src=" to that page. Then "target=nameofiframe" will be the same for
each one.

<a href="#" src="www.google.com" target="myiframe">Click for
google</a>
<a href="#" src="www.yahoo.com" target="myiframe">Click for yahoo</a>

<iframe name="myiframe"></iframe>
 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      04-07-2009
In article <>,
richard <> wrote:

> I think I understand what you are looking for.


Not sure you do?

--
dorayme
 
Reply With Quote
 
Fokke Nauta
Guest
Posts: n/a
 
      04-07-2009
"richard" <> wrote in message
news:...
> On Mon, 6 Apr 2009 19:32:42 +0200, "Fokke Nauta" <>
> wrote:
>
>>Hi all,
>>
>>I have a page (main.htm) with a few links. I want each link to open the
>>same
>>page (index2.htm) which contains an iframe. This is not a problem, but I
>>want each link to open that page with another iframe loading. So - for
>>example - the 1st link on main.htm opens index2.htm, which loads
>>3rdpage_1.htm in the iframe.. The 2nd links on main.htm opens index2.htm
>>as
>>well, but loading with 3rdpage_2.htm in the iframe. And so on.
>>Can this be done? And if so, how can I manage this?
>>
>>Thanks in advance.
>>
>>With best regards,
>>Fokke Nauta
>>
>>

>
> I think I understand what you are looking for.
>
> The trick is, in your links. If you have one iframe and want each link
> to open a seperate page inside it, then all you do is change the
> "src=" to that page. Then "target=nameofiframe" will be the same for
> each one.
>
> <a href="#" src="www.google.com" target="myiframe">Click for
> google</a>
> <a href="#" src="www.yahoo.com" target="myiframe">Click for yahoo</a>
>
> <iframe name="myiframe"></iframe>


Thanks, but that was not what I was looking for.
This is not the problem
What I want is as follows:
I have a page, the 1st page. This page contains a few links.
Each links opens the same second page. This is not a problem.
But the 2nd page has an iframe. And I want this 2nd page to open a 3rd page
inside the iframe. These 3rd pages are all different. This page must be
specified by the link on the 1st page.
So when I click on the 1st link on the 1st page, the 2nd page opens with the
1st third page in the iframe.
When I click on the 2nd link on the 1st page, the 2nd page opens with the
2nd third page in the iframe.

I hope I made myself clear now.

Regards,
Fokke


 
Reply With Quote
 
Neredbojias
Guest
Posts: n/a
 
      04-07-2009
On 06 Apr 2009, "Fokke Nauta" <> wrote:

> Hi all,
>
> I have a page (main.htm) with a few links. I want each link to open
> the same page (index2.htm) which contains an iframe. This is not a
> problem, but I want each link to open that page with another iframe
> loading. So - for example - the 1st link on main.htm opens
> index2.htm, which loads 3rdpage_1.htm in the iframe.. The 2nd links
> on main.htm opens index2.htm as well, but loading with 3rdpage_2.htm
> in the iframe. And so on. Can this be done? And if so, how can I
> manage this?


Basic javascript solution:

http://www.neredbojias.net/_dem/main.html

(View/Source for markup.)

--
Neredbojias
People who live in glass houses must feel funny peeing.
http://www.neredbojias.org/
http://www.neredbojias.net/
 
Reply With Quote
 
Fokke Nauta
Guest
Posts: n/a
 
      04-07-2009
"Neredbojias" <> wrote in message
news: .net...
> On 06 Apr 2009, "Fokke Nauta" <> wrote:
>
>> Hi all,
>>
>> I have a page (main.htm) with a few links. I want each link to open
>> the same page (index2.htm) which contains an iframe. This is not a
>> problem, but I want each link to open that page with another iframe
>> loading. So - for example - the 1st link on main.htm opens
>> index2.htm, which loads 3rdpage_1.htm in the iframe.. The 2nd links
>> on main.htm opens index2.htm as well, but loading with 3rdpage_2.htm
>> in the iframe. And so on. Can this be done? And if so, how can I
>> manage this?

>
> Basic javascript solution:
>
> http://www.neredbojias.net/_dem/main.html
>
> (View/Source for markup.)
>
> --
> Neredbojias
> People who live in glass houses must feel funny peeing.
> http://www.neredbojias.org/
> http://www.neredbojias.net/


Hi Neredbojias,

Thanks very much. This is exactly what I meant. Great!!
I'm not familiar with javascriopt, only a very basic knowledge.
Once again, thanks!

With best regards,
Fokke


 
Reply With Quote
 
Fokke Nauta
Guest
Posts: n/a
 
      04-07-2009

"Neredbojias" <> wrote in message
news: .net...
> On 06 Apr 2009, "Fokke Nauta" <> wrote:
>
>> Hi all,
>>
>> I have a page (main.htm) with a few links. I want each link to open
>> the same page (index2.htm) which contains an iframe. This is not a
>> problem, but I want each link to open that page with another iframe
>> loading. So - for example - the 1st link on main.htm opens
>> index2.htm, which loads 3rdpage_1.htm in the iframe.. The 2nd links
>> on main.htm opens index2.htm as well, but loading with 3rdpage_2.htm
>> in the iframe. And so on. Can this be done? And if so, how can I
>> manage this?

>
> Basic javascript solution:
>
> http://www.neredbojias.net/_dem/main.html
>
> (View/Source for markup.)
>
> --
> Neredbojias
> People who live in glass houses must feel funny peeing.
> http://www.neredbojias.org/
> http://www.neredbojias.net/


Hi,

I turned your script into this (see underneath) and it worked!
You can find it on www.fokkenauta.nl

Cheers,
Fokke

<script type="text/javascript">

var s;

if (location.search.slice(1)=='a') {
s='computerdocent.htm';
} else if (location.search.slice(1)=='b') {
s='cursusoverzicht.htm';
} else if (location.search.slice(1)=='c') {
s='opmaat.htm';
} else if (location.search.slice(1)=='d') {
s='fokke.htm';
} else if (location.search.slice(1)=='e') {
s='contact.htm';
}

if (location.search.slice(1)=='e') {
document.write('<div><iframe id="ifr" src="' + s + '" scrolling="auto"
ALLOWTRANSPARENCY> <\/iframe><\/div>');
} else {
document.write('<div><iframe id="ifr" src="' + s + '" scrolling="auto"
style="FILTER: chroma(color=#fffffe)" ALLOWTRANSPARENCY>
<\/iframe><\/div>');
}

</script>


 
Reply With Quote
 
richard
Guest
Posts: n/a
 
      04-07-2009
On Tue, 7 Apr 2009 14:06:07 +0200, "Fokke Nauta" <>
wrote:

>
>"Neredbojias" <> wrote in message
>news: i.net...
>> On 06 Apr 2009, "Fokke Nauta" <> wrote:
>>
>>> Hi all,
>>>
>>> I have a page (main.htm) with a few links. I want each link to open
>>> the same page (index2.htm) which contains an iframe. This is not a
>>> problem, but I want each link to open that page with another iframe
>>> loading. So - for example - the 1st link on main.htm opens
>>> index2.htm, which loads 3rdpage_1.htm in the iframe.. The 2nd links
>>> on main.htm opens index2.htm as well, but loading with 3rdpage_2.htm
>>> in the iframe. And so on. Can this be done? And if so, how can I
>>> manage this?

>>
>> Basic javascript solution:
>>
>> http://www.neredbojias.net/_dem/main.html
>>
>> (View/Source for markup.)
>>
>> --
>> Neredbojias
>> People who live in glass houses must feel funny peeing.
>> http://www.neredbojias.org/
>> http://www.neredbojias.net/

>
>Hi,
>
>I turned your script into this (see underneath) and it worked!
>You can find it on www.fokkenauta.nl
>
>Cheers,
>Fokke
>



Do not understand why you need all that crap just to do a simple
frameset.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
order of iframe loading with document loading ofir Javascript 0 12-03-2007 12:06 PM
wait for one IFRAME to load before loading a second IFRAME Mel Javascript 1 06-08-2005 02:31 PM
Loading successive pages an IFrame using Java? Mr. Bill HTML 6 01-23-2004 01:48 AM
Get form values from iframe (1) to iframe (2) inside a layer in iframe (1) Daedalous Javascript 3 01-16-2004 11:08 AM
loading iFrame pages (other than the defualt) MJ Baldwin HTML 3 12-21-2003 07:01 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57