Help with HTML frames

J

Jayson

Hi All,

I'm developing a website which will have a banner and control buttons
at the top of the page, which I want to always be visible. Each
button can be in 4 different states depending on whether it is the
current page, the mouse is hovering over it, it has been pressed, or
none of the above. I have all that done, but the problem I'm having
is with HTML frames. When I click the control button to switch pages,
instead of opening the new page in the lower frame, it opens a new
window, (or new tab in my case as I'm running IE7).

I have included the problematic pages below, and I think the issue has
something to do with which frame name I'm calling from the <a ref
target> in the AboutFixed and ServicesFixed pages, but I've tried both
the Fixed and Scroll frame names and get the same result. Is it even
possible to have 2 dynamic frames on the same page, because I think
that's where I'm falling down. I need to have 2 due to the changing
nature of the control buttons.

About.htm
<HTML>

<HEAD>

<TITLE>About</TITLE>

</HEAD>

<FRAMESET rows="183,*" frameborder="no" framespacing="0" border="0"
resize="no">

<FRAME name="AboutFixed" src="C:\Test\AboutFixed.htm">
<FRAME name="AboutScroll" src="C:\Test\AboutScroll.htm">

</FRAMESET>

</HTML>

AboutFixed.htm
<HTML>

<HEAD>

<STYLE type="text/css">
img {border: 0}
body {font-family: Arial; font-size: 8pt; color: white; background-
color: black}
</STYLE>

<TITLE>About</TITLE>

<img src="Banner.jpg">

</HEAD>

<SCRIPT language="VBScript">

Sub ServicesOver()
Document.Images(02).src = "C:\Test\Services\ServicesOver.jpg"
End Sub

Sub ServicesOut()
Document.Images(02).src = "C:\Test\Services\Services.jpg"
End Sub

Sub ServicesDown()
Document.Images(02).src = "C:\Test\Services\ServicesDown.jpg"
End sub

</SCRIPT>

<BODY>

<div style="position:absolute; top:102; left:50;">
<img src="C:\Test\About\AboutCurrent.jpg">
</div>

<div style="position:absolute; top:102; left:250;">
<a href="C:\Test\Services.htm" target="ServicesScroll"><img src="C:
\Test\Services\Services.jpg" onMouseOver="ServicesOver"
onMouseOut="ServicesOut" onMouseDown="ServicesDown"></a>
</div>

</BODY>

</HTML>

AboutScroll.htm
<HTML>

<HEAD>

<STYLE type="text/css">
p {font-family: Arial; font-size: 12pt; color: white}
img {border: 0}
body {background-color: black}
</STYLE>

</HEAD>

<BODY>

<p>This is some text from the About page.</p>

</BODY>

</HTML>

Services.htm
<HTML>

<FRAMESET rows="183,*" frameborder="no" framespacing="0" border="0"
resize="no">

<FRAME name="ServicesFixed" src="C:\Test\ServicesFixed.htm">
<FRAME name="ServicesScroll" src="C:\Test\ServicesScroll.htm">

</FRAMESET>

</HTML>

ServicesFixed.htm
<HTML>

<HEAD>

<STYLE type="text/css">
img {border: 0}
body {font-family: Arial; font-size: 8pt; color: white; background-
color: black}
</STYLE>

<TITLE>Services</TITLE>

<img src="Banner.jpg">

</HEAD>

<SCRIPT language="VBScript">

Sub AboutOver()
Document.Images(01).src = "C:\Test\About\AboutOver.jpg"
End Sub

Sub AboutOut()
Document.Images(01).src = "C:\Test\About\About.jpg"
End Sub

Sub AboutDown()
Document.Images(01).src = "C:\Test\About\AboutDown.jpg"
End sub

</SCRIPT>

<BODY>

<div style="position:absolute; top:102; left:50;">
<a href="C:\Test\About.htm" target="AboutFixed"><img src="C:\Test
\About\About.jpg" onMouseOver="AboutOver" onMouseOut="AboutOut"
onMouseDown="AboutDown"></a>
</div>

<div style="position:absolute; top:102; left:250;">
<img src="C:\Test\Services\ServicesCurrent.jpg">
</div>

</BODY>

</HTML>

ServicesScroll.htm
<HTML>

<HEAD>

<STYLE type="text/css">
p {font-family: Arial; font-size: 12pt; color: white}
img {border: 0}
body {background-color: black}
</STYLE>

</HEAD>

<BODY>

<p>This is some text from the Services page.</p>

</BODY>

</HTML>
 
N

Neredbojias

Well bust mah britches and call me cheeky, on Thu, 18 Oct 2007 03:10:35 GMT
Jayson scribed:
Hi All,

I'm developing a website which will have a banner and control buttons
at the top of the page, which I want to always be visible. Each
button can be in 4 different states depending on whether it is the
current page, the mouse is hovering over it, it has been pressed, or
none of the above. I have all that done, but the problem I'm having
is with HTML frames. When I click the control button to switch pages,
instead of opening the new page in the lower frame, it opens a new
window, (or new tab in my case as I'm running IE7).

I have included the problematic pages below,
...snip...

Problematic is right. The markup is about 10 years old. Unless you update
your skills, any help you might get will be essentially useless, anyway.
 
R

rf

Neredbojias said:
Well bust mah britches and call me cheeky, on Thu, 18 Oct 2007 03:10:35
GMT
Jayson scribed:
Problematic is right. The markup is about 10 years old.

and will *only* even possibly work in IE so is unsuitable for the web
anyway.
 
J

Jayson

Well then can you please suggest an alternative method of achieving
the effect I want?
 
D

dorayme

Jayson said:
Well then can you please suggest an alternative method of achieving
the effect I want?

Would you care to tell me what effect you want? The dorayme quick
and dirty effects department is open at various times of today.
 
S

Sean Fritz

Well then can you please suggest an alternative method of achieving
the effect I want?

You might want to learn some PHP, then just include your external
navigation and whatever else into the page.

Frames are dead.
 
T

Tim Streater

Sean Fritz said:
You might want to learn some PHP, then just include your external
navigation and whatever else into the page.

This might be true - can't tell as I didn't see the OP's post.
Frames are dead.

This, on the other hand, is rubbish.
 
R

rf

Jayson said:
Well then can you please suggest an alternative method of achieving
the effect I want?

One of your requirements is that the nav bar (what you call the control
buttons) remains visible at all times.

Remove this requirement and you achieve two things:

1) You free up screen real estate that could be more profitly used
displaying your content, after your viewer has scrolled down a bit.

2) You can drop the frames. Google for "frames are evil".

Have a good look round the internet. How many frame sites to you see,
compared to ordinary ones that scroll up and down?

Of the frames sites you have found, how many are as easy to use/bookmark as
the ordinary ones you have found?
 
T

Tim Streater

"rf said:
Tim Streater said:
Care to cite any modern (that is, this century) source that advocates the
use of frames? And I mean a proper source, not some web dreziners blog.

It's the blanket statement that is rubbish. Frames (and iframes) are
working just fine for my application (for a closed community of
engineers).
 
R

rf

Tim Streater said:
rf said:
It's the blanket statement that is rubbish. Frames (and iframes) are
working just fine for my application (for a closed community of
engineers).

How many engineers? 20? Out of say 2,000,000,000 internet users?
 
D

dorayme

"rf said:
How many engineers? 20? Out of say 2,000,000,000 internet users?

well, I don't think, to be fair, Tim is taking some position that
these facts are all that relevant to. Yeah I know... but frames,
when done well (a rare thing) are not an incompetent thing to
implement, especially with a restricted audience or for CD or
other distributed media.

There is no point reviewing all the evils of frames every time
the poor things rear their heads. They have one huge advantage in
that they perfectly implement the no-scrolling navigation menu.
One of the silliest things ever in the history of mankind is how
we have all gotten so used to useful navigation doing the
disappearing act like the bloody station leaving the station
along with the train! O, we say, that is just standard practice.
Live with it. The alternatives with position: fixed and other
things made Spartanicus (god)'s browser jerky...

I will stop now. Tim, it irritates me too to keep seeing the word
"frames" in the same sentence as "evil" or "dead". I prefer
sunnier associations. I kinda like:

Marilyn Monroe
Henry Fonda
Red
Triumph motorbikes
Angle grinder
Macintosh G4 Quicksilver
Coogee beach

and hell... even...

Thredbo (I have a nce 35mm B & W of me on a Trumpy at Thredbo...)
 
T

Tim Streater

dorayme said:
well, I don't think, to be fair, Tim is taking some position that
these facts are all that relevant to. Yeah I know... but frames,
when done well (a rare thing) are not an incompetent thing to
implement, especially with a restricted audience or for CD or
other distributed media.

There is no point reviewing all the evils of frames every time
the poor things rear their heads. They have one huge advantage in
that they perfectly implement the no-scrolling navigation menu.
One of the silliest things ever in the history of mankind is how
we have all gotten so used to useful navigation doing the
disappearing act like the bloody station leaving the station
along with the train! O, we say, that is just standard practice.
Live with it. The alternatives with position: fixed and other
things made Spartanicus (god)'s browser jerky...

I will stop now. Tim, it irritates me too to keep seeing the word
"frames" in the same sentence as "evil" or "dead". I prefer
sunnier associations. I kinda like:

Well, I agree. What I observe is that every time someone (I assume to be
a newbie, but perhaps not) comes here in search of help with frames, the
general reaction is to say "Frames dead" or "Frames evil" etc etc.

I have described here before that I use iframes in a particular way -
the application would simply not scale to the amount of data in our
database without. I use frames to implement a set of tabs that the user
can click to change the content of a frame occupying most of the screen
(below the bar of tabs, other headers, etc), because there is too much
into to put it all on one screen.

I got grudging acknowledgement on a previous occasion that my use of
iframes was appropriate. Perhaps there is a better way to implement this
- but I won't be changing it any time soon, even if there is.

If people said "You should use xyz instead of frames, and here's why,
and here's an example using xyz that functions identically to this
example using frames, and here's why its better" then sceptics like me
might pay more attention.
 
N

Neredbojias

Well bust mah britches and call me cheeky, on Fri, 19 Oct 2007 13:06:38
GMT Tim Streater scribed:
....
If people said "You should use xyz instead of frames, and here's why,
and here's an example using xyz that functions identically to this
example using frames, and here's why its better" then sceptics like me
might pay more attention.

But if people always said what you wanted them to say, you'd have no excuse
to opt out from better methods of engineering your page...

Here's an example of a non-frames page with a stationary header and footer:

http://www.neredbojias.com/_a/whelan1.html

The nav happens to be in the header, but it could be anywhere. This page
works in ie6, ie7, firefox, and opera - all the browsers I am currently
able to test. No, the markup isn't exactly a "piece of cake", but neither
is it so esoteric as to be improbably conformed. The point is don't be so
lazy and you may be surprised by what you can do.
 
T

Tim Streater

Neredbojias said:
Well bust mah britches and call me cheeky, on Fri, 19 Oct 2007 13:06:38
GMT Tim Streater scribed:


But if people always said what you wanted them to say, you'd have no excuse
to opt out from better methods of engineering your page...

Here's an example of a non-frames page with a stationary header and footer:

http://www.neredbojias.com/_a/whelan1.html

The nav happens to be in the header, but it could be anywhere. This page
works in ie6, ie7, firefox, and opera - all the browsers I am currently
able to test. No, the markup isn't exactly a "piece of cake", but neither
is it so esoteric as to be improbably conformed. The point is don't be so
lazy and you may be surprised by what you can do.

Again, you don't say why it's better, you merely assert that it is.

What I have created works just fine. Changing it to another approach is
way down my list of priorities.
 
B

Beauregard T. Shagnasty

Tim said:
Again, you don't say why it's better, you merely assert that it is.

1. There is only one page to deal with, not three or four (frameset,
heading page, nav page, footer page, and of course, content page).

2. While looking at any of the sub-pages (in this case images), a
visitor can *bookmark* the sub-page, unlike in frames where only the
frameset page can be bookmarked.

3. Assuming pages of text rather than images, Google will index the
content on the sub-page, and when a visitor goes there (direct link sans
frameset), there is *no* header, footer, and more importantly, no
navigation.

That should do it, eh?
 
W

William Gill

rf said:
How many engineers? 20? Out of say 2,000,000,000 internet users?

I think the point is the right tool for the job at hand. When designing
an app for the 20, what do the 2,000,000,000 have to do with it. I have
never used frames (even last century) for all the frequently cited
reasons, and because browser real estate is too precious to waste.
However, now I am now using them for a relational database edit
interface. The user community is even smaller(1) so I have complete
control over all aspects of browser choice, plug-in availability,
feature enabled/disabled, and anything else. Do I need to consider
2,000,000,000 internet users? With the exception of iframes, I can't
see any better way to access, display, and edit data from several
related db tables, and developing a stand alone gui is a pain in the
a**. So, while I don't use frames for commercial sites, I would be
disappointed to see "evil" frames actually "die."

This reminds me of the "no Flash is good Flash" arguments I see here so
frequently. Come to think of it, it reminds me of a lot of "One true
religion" arguments. Call me an html heretic if you like.
 
W

William Gill

dorayme said:
Triumph motorbikes

I never referred to my Bonneville as a motorbike, though I did raise an
eyebrow or two calling it "my scooter." Now I call my ride a Harley,
and no one gets confused.
 
T

Tim Streater

"Beauregard T. Shagnasty said:
1. There is only one page to deal with, not three or four (frameset,
heading page, nav page, footer page, and of course, content page).

It may ease the implementer's task, but so what.
2. While looking at any of the sub-pages (in this case images), a
visitor can *bookmark* the sub-page, unlike in frames where only the
frameset page can be bookmarked.

The main page in my app is reached via a table on another page. The
table contents may change (not very often, but it happens) based on
database contents. So they shouldn't be bookmarking even the main page,
as it may not exist at some future point. And they certainly shouldn't
be bookmarking the sub pages, as they are likely to get rubbish (data is
passed back and forth via JS variables in the top frame).

In fact, if I had my way, I'd prevent any of these going into the
history stack.
3. Assuming pages of text rather than images, Google will index the
content on the sub-page, and when a visitor goes there (direct link sans
frameset), there is *no* header, footer, and more importantly, no
navigation.

Google doesn't need to know anything about any of my app's pages -
indeed, shouldn't because the users need to login to reach them.
That should do it, eh?

Yep, sure does.
 

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

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top