Loading different pages in an iframe

F

Fokke Nauta

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
 
D

dorayme

"Fokke Nauta said:
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
 
F

Fokke Nauta

dorayme said:
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.

Fokke
 
R

richard

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>
 
F

Fokke Nauta

richard said:
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
 
N

Neredbojias

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.)
 
F

Fokke Nauta

Neredbojias said:
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>
 
R

richard

I wanted to use an iframe, not a frame.

Fokke

Then get rid of the frameset.
Use a single page and put the iframe on that page.


<html>
<head>
</head>
<body>

links
blah blah
<iframe src="" name=""></iframe>
</body>
</html>
 
A

Adrienne Boswell

Then get rid of the frameset.
Use a single page and put the iframe on that page.


<html>
<head>
</head>
<body>

links
blah blah
<iframe src="" name=""></iframe>
</body>
</html>

Richard, are you really that dense? Did you read ANY of this thread?
The OP is not talking about a frameset, he is talking about an iframe on
a single page.
 
R

rf

Adrienne said:
Richard, are you really that dense? Did you read ANY of this thread?
The OP is not talking about a frameset, he is talking about an iframe
on a single page.

Remarkabe as it seems Richard is actually correct on this one. The page at
www.fokkenauta.nl is a frameset. Totally unneeded though, only one actual
used frame and one empty one. On drilling down though the source code is
atrocious.
 
R

richard

Richard, are you really that dense? Did you read ANY of this thread?
The OP is not talking about a frameset, he is talking about an iframe on
a single page.

Obviously you didn't bother to look at the page he cited.
In which he used a standard frameset.
The only mention of an iframe was in the JS.
 
D

dorayme

"rf said:
The page at
www.fokkenauta.nl is a frameset. Totally unneeded though, only one actual
used frame and one empty one. On drilling down though the source code is
atrocious.

OP might be interested to raise these issues here before going in for
javascript solutions and digging deeper holes or is it fitting the
Titanic with some last minute frills? <g>
 
N

Neredbojias

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

Javascript is a very versatile and useful language whose power has been
abused in the past. Safeguards have been increasingly added over the
years, but, unfortunately, there are still those out there who would
use it intrusively or downright maliciously. One thing to remember:
visitors to your site may have it turned off so your page should be
adequately prepared to deal with that.

Anyway, best wishes on your endeavor, Nederlander, and I hope you don't
get any splinters in your feet...
 
F

Fokke Nauta

dorayme said:
OP might be interested to raise these issues here before going in for
javascript solutions and digging deeper holes or is it fitting the
Titanic with some last minute frills? <g>

Please see my other post above. Obviously you are all looking to the wrong
site as the domain seems not replaced yet.

www.iae.nl/users/fnauta/fokkenauta is a direct link to the correct site.

Fokke
 
F

Fokke Nauta

rf said:
Remarkabe as it seems Richard is actually correct on this one. The page at
www.fokkenauta.nl is a frameset. Totally unneeded though, only one actual
used frame and one empty one. On drilling down though the source code is
atrocious.

The page on www.fokkenauta.nl is definitely not a frameset but a page with a
table. It is exactly what I said I wanted to do.
But ... The domain www.fokkenauta.nl pointed to my old website, which is a
frameset indeed. I changed it only yesterday. Could it be that you are still
looking to my old website?
The direct link to the website I am talking about is
www.iae.nl/users/fnauta/fokkenauta

Please take a look at this one and you will be sure that you have the
correct site.

Fokke
 
F

Fokke Nauta

richard said:
Obviously you didn't bother to look at the page he cited.
In which he used a standard frameset.
The only mention of an iframe was in the JS.

The page on www.fokkenauta.nl is definitely not a frameset but a page with a
table. It is exactly what I said I wanted to do.
But ... The domain www.fokkenauta.nl pointed to my old website, which is a
frameset indeed. I changed it only yesterday. Could it be that you are still
looking to my old website?
The direct link to the website I am talking about is
www.iae.nl/users/fnauta/fokkenauta

Please take a look at this one and you will be sure that you have the
correct site.

Fokke
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top