Python and HTML frames

Jiri Baum jiri at baum.com.au
Sat Jun 1 06:35:07 EDT 2002


Ken:
> How do I output HTML onto frames? This code below doesn't work. Can
> someone help me?

This isn't really a python question, it's a HTML question (or possibly
HTTP; are you ouputting the right headers?). However, I should note that
setting scrolling to "no" is a really, really bad idea unless the frame
contains just an image, because not all people have the same-sized fonts.

I trust you've read the guidelines for using frames at www.useit.com ?
Briefly: don't, and if you have to, make all links TARGET="_top".

> ==
> def mainpagelayout():
>        print """
>        <head><title>Languages Dictionary</title></head>

>        <frameset rows="70,40,*" scroll=no frameborder="NO" border="0">
>        <frame src="title.html" name=Title scrolling=no noresize>
>        <frame src="topmenu2.html" name=TopMenu scrolling=no noresize>

>        <frameset cols="*, 200" frameborder="NO" border="0">
>        <frame src="main2.html" name=Main scrolling=auto>
>        <frame src="sidemenu2.html" name=SideMenu scrolling=auto>
>        </frameset> </frameset>

You're missing a <noframes> here, and your <body> tags are in the wrong
place, but in any case this message is so useless that it beggars belief.
The basic point of the web is to communicate: to get information from one
person to another. Design of web pages should be guided by this goal. If it
isn't, then it becomes an impediment and the whole exercise pointless.

In any case, anyone who is shown this image will go away in disgust. You
might as well not have it. If your page really, really needs frames (and I
doubt it), at least apologise here and explain why.

>        <body>This page doesn't work without a frames-enabled
> browser.</body>
>        </noframes></body></html>
>        """


Jiri
-- 
Jiri Baum <jiri at baum.com.au>           http://www.csse.monash.edu.au/~jirib
  MAT LinuxPLC project --- http://mat.sf.net --- Machine Automation Tools



More information about the Python-list mailing list