Page 1 of 1
HTML frame problem
Posted: Tue Dec 20, 2005 12:51 pm
by PB
I've just started delving into HTML to do a manual for one of my apps, and
I thought frames were supposed to be as simple as this:
Code: Select all
<html>
<head>
<meta name="author" content="PB">
</head>
<title>Instruction Manual</title>
<frameset cols="200,*">
<frame name="index" src="http://www.purebasic.com/" scrolling="auto">
<frame name="main" src="http://www.google.com/" scrolling="auto">
</frameset>
</html>
When I load the above HTML page in IE and FF, nothing is seen... why not?
And my aim is NOT to load an external web page, but to load local files from
a "Data" sub-folder, like this:
Code: Select all
<frame name="index" src="Data\index.htm" scrolling="auto">
But none of it works... I just get a blank page with both browsers.

Posted: Tue Dec 20, 2005 1:09 pm
by utopiomania
It works perfect here, both with external web pages and local files.
Posted: Tue Dec 20, 2005 2:56 pm
by SEO
Hi,
Try to 'skip' framesets!
If you have 10 browsers, then you have 10 differents results...
An 'programmer' use include files!
Regards,
SEO
Re: HTML frame problem
Posted: Tue Dec 20, 2005 3:17 pm
by Trond
PB wrote:I've just started delving into HTML to do a manual for one of my apps, and
I thought frames were supposed to be as simple as this:
Code: Select all
<html>
<head>
<meta name="author" content="PB">
</head>
<title>Instruction Manual</title>
<frameset cols="200,*">
<frame name="index" src="http://www.purebasic.com/" scrolling="auto">
<frame name="main" src="http://www.google.com/" scrolling="auto">
</frameset>
</html>
When I load the above HTML page in IE and FF, nothing is seen... why not?
And my aim is NOT to load an external web page, but to load local files from
a "Data" sub-folder, like this:
Code: Select all
<frame name="index" src="Data\index.htm" scrolling="auto">
But none of it works... I just get a blank page with both browsers.

The posted code works here with google and purebasic. The data slash is wrong way, it should be the other way, and always use only small letters in paths that are to be displayed in web browsers, it will save you from problems in the future.
Posted: Tue Dec 20, 2005 8:35 pm
by PB
Okay, I worked it out -- I actually had...
...after the "<title>" line (but not in the example I posted because I didn't
think it was relevant) which was stopping it working. But I've now placed
it after the frameset commands, and all is working as expected.
BTW, thanks for the tip about the backslash and lowercase characters, but
does that really matter when the page is just reading local disk files? And
yes, I will be using frames because Firefox, Opera and Internet Explorer
support them, so it's no problem. (Safari doesn't count because my app
is not for the Mac).

Posted: Tue Dec 20, 2005 8:42 pm
by traumatic
I don't think this matters but <body> has to go after </head> and
the correct way to define colors is to use #hexvalue, i.e. <body bgcolor="#eeeeff">.
If you're using <body> in your frameset-page, it will only be displayed
if the browser doesn't support them btw.
Posted: Tue Dec 20, 2005 8:44 pm
by PB
Thanks Traumatic, I actually edited my post just before you replied, and it's
all working now. And I will use the # character for the colors too -- thanks!
Posted: Tue Dec 20, 2005 8:46 pm
by Trond
PB wrote:Okay, I worked it out -- I actually had...
...after the "<title>" line (but not in the example I posted because I didn't
think it was relevant) which was stopping it working. But I've now placed
it after the frameset commands, and all is working as expected.

The frameset should be INSIDE the body if I'm not wrong.
PB wrote:BTW, thanks for the tip about the backslash and lowercase characters, but
does that really matter when the page is just reading local disk files? And
yes, I will be using frames because Firefox, Opera and Internet Explorer
support them, so it's no problem. (Safari doesn't count because my app
is not for the Mac).

Of course it won't matter on YOUR computer but since you are writing a documentation for something I assume you are going to distribute it. Upload it to a webserver: boom won't work. Try to view on any Unix system (Linux +++): boom won't work.
Per definition, the slash should go this way: / in an URL. The small or large letters will work everywhere as long as you don't miscapitalize some place, which is very easy to do since it works for you locally even though the capitalization is incorrect.
Edit: If you app can be used from the command-line don't use frames in your documentation to allow it to be properly read by text browsers like Links.
Posted: Tue Dec 20, 2005 8:49 pm
by Dare2
I thought <BODY> only happened if <FRAMESET> was not supported.?
Otherwise it is ignored.
So <HEAD>..</HEAD><FRAMESET>..</FRAMESET><BODY>You need frames</BODY>
Not so?
Edit: Probaby safe (perhaps even "safer") nowadays to use <iframe ..>. Perhaps embedded in a <table or <div?
Posted: Tue Dec 20, 2005 9:00 pm
by PB
> since you are writing a documentation for something I assume you are
> going to distribute it
Yes, but the manual is just planned to be a local HTML file, and not accessed
from the web at any time (eg. it'll be launched via ShellExecute when the user
selects it, and maybe even inside a WebGadget). So it should be okay?
> If you app can be used from the command-line don't use frames
No, it's not command-line based. Just a window with some functions.
Posted: Tue Dec 20, 2005 9:16 pm
by SEO
Hi again,
Sorry, it was only a try to warn you using framesets (and others).
I have not said anything about Safari. XHTML/HTML if it is written as it should ,is the best 'Cross Platform' (markup) language... And I can't see why to stop this....
If you using frame sets on the web you lost some other features that is more important ...
Reagrads,
SEO
Posted: Tue Dec 20, 2005 9:58 pm
by Trond
Sorry, it should be like this:
Code: Select all
<html>
<head>
<title>Title</title>
</head>
<frameset cols="20%,*">
<frame name="index" src="http://www.purebasic.com/">
<frame name="main" src="http://www.google.com/">
</frameset>
<noframes>
<body>
<a href="subfolder/file.htm"> subfolder<b>/</b>file.htm </a>
</body>
</noframes>
</html>