Use frameset with other HTML elements in page
I have a page in which I want to include frameset, as well as use other HTML elements (basically some hidden form fields). But where can I place those additional HTML elements in the code ?
<frameset cols="*" rows开发者_如何学Go="40,*">
<frame src="#" />
<frame src="#"/>
<noframes>
<body>
Please enable frames to view.
</body>
</noframes>
</frameset>
Standard web page has following layout:
<html>
<head>
<title>Simple html document</title>
<!-- Headers here -->
</head>
<body>
<!-- Body here -->
</body>
</html>
A frameset document has head
and frameset
instead of body
.
<html>
<head>
<!-- Headers here -->
</head>
<frameset cols="20%, 80%">
<frameset rows="100, 200">
<frame src="contents_of_frame1.html">
<frame src="contents_of_frame2.gif">
</frameset>
<frame src="contents_of_frame3.html">
<noframes>
<p>This frameset document contains:</p>
<ul>
<li><A href="contents_of_frame1.html">Some neat contents</A>
<li><IMG src="contents_of_frame2.gif" alt="A neat image">
<li><A href="contents_of_frame3.html">Some other neat contents</A>
</ul>
</noframes>
</frameset>
</html>
So if you wish to include some html elements you must include it in one of the frames. Or simply add one additional frame that doesn't take place and incorporate html elements (hidden input fields) there.
On the other side if you wish those html elements in the case that browser doesn't support frameset or they are disabled, then include them in <noframes>
also.
Frames are SO nineties :) Do you really have a valid reason to use them? :) There are LOTS of reasons to avoid them...
Anyway, each frame has its own life, so it depends on which frame does the posting. If you put them in frame X, then you will need to do the posting from that frame, and the others will stay in their state, unaffected.
Either use an <iframe>
to put your document with <frameset>
inside, or use an <iframe>
for each of your framed documents.
精彩评论