HTML frame problem

For everything that's not in any way related to PureBasic. General chat etc...
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

HTML frame problem

Post 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. :(
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
utopiomania
Addict
Addict
Posts: 1655
Joined: Tue May 10, 2005 10:00 pm
Location: Norway

Post by utopiomania »

It works perfect here, both with external web pages and local files.
SEO
Enthusiast
Enthusiast
Posts: 178
Joined: Fri Dec 09, 2005 11:42 pm
Location: Sweden
Contact:

Post 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
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: HTML frame problem

Post 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.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

Okay, I worked it out -- I actually had...

Code: Select all

<body bgcolor="eeeeff"></body>
...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). ;)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

PB wrote:

Code: Select all

<body bgcolor="eeeeff">
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.
Good programmers don't comment their code. It was hard to write, should be hard to read.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post 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!
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

PB wrote:Okay, I worked it out -- I actually had...

Code: Select all

<body bgcolor="eeeeff"></body>
...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.
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post 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?
@}--`--,-- A rose by any other name ..
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post 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.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
SEO
Enthusiast
Enthusiast
Posts: 178
Joined: Fri Dec 09, 2005 11:42 pm
Location: Sweden
Contact:

Post 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
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post 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>
Post Reply