Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Build one file with 2 linked frames ? 1

Status
Not open for further replies.

MoshiachNow

IS-IT--Management
Feb 6, 2002
1,851
IL
HI,

Beeing fairly new to html,I'm writing a Perl script that should result in a log file,displayed as .html having two frames.
Left navigation frame should have links to anchors in the right frame.
Is it doable ,preferebly in one html file,and how ?
Thanks

Long live king Moshiach !
 
To do it with a single HTML file, you'd need to use the "iframe" element - otherwise you'd need multiple HTML files to be able to use "regular" frames.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
As you can't include content inbetween iframe tags, you either will need a new file (defeats what you're after), or you'll need to write out the content using JS from your one file.

Take this example:

Code:
[ignore]<html>
<head>
	<script type="text/javascript">

		var data = '';
		data += '<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Phasellus orci dolor, tincidunt eu, ultricies eu, tempus non, tellus. Sed purus velit, pulvinar ut, porta vel, ornare vitae, sapien. Proin convallis lacus eget tortor.</p>';
		data += '<a name="link1"></a>';
		data += '<p>Aenean dictum posuere nunc. In enim elit, sollicitudin ac, lobortis at, hendrerit ac, ipsum. Morbi vitae odio sed erat congue posuere. Vestibulum vel ante eu libero blandit tristique.</p>';
		data += '<p>Nulla enim.</p>';
		data += '<p>Phasellus non diam a nibh lacinia volutpat. Ut accumsan diam ac leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>';
		data += '<a name="link2"></a>';
		data += '<p>Nulla in odio. Proin mi dolor, ullamcorper bibendum, pulvinar aliquam, semper eget, velit. Sed cursus odio sed lectus.</p>';
		data += '<p>In sit amet mi ac risus pretium faucibus. Vivamus nisi libero, vestibulum at, tempor eget, convallis et, urna. Quisque congue, tellus vitae porttitor suscipit, nisi turpis sollicitudin eros, sit amet adipiscing nulla ipsum sit amet elit.</p>';
		data += '<p>Nulla at risus sit amet eros ullamcorper semper. Morbi vel nibh sed lacus scelerisque nonummy. Etiam diam urna, vestibulum a, vulputate placerat, pellentesque vel, enim.</p>';
		data += '<a name="link3"></a>';
		data += '<p>Fusce purus massa, lacinia vitae, tincidunt vitae, fringilla et, est. Donec vitae neque sit amet quam imperdiet suscipit. Praesent imperdiet. Sed dictum. Donec sed enim.</p>';

		// Write data into iframe
		window.onload = function() {
			var ifrm = window.frames['myFrame'];
			ifrm.document.open();
			ifrm.document.write(data);
			ifrm.document.close();
		}

	</script>
</head>
<body>
	<ul>
		<li><a href="#link1" target="myFrame">Link 1</a></li>
		<li><a href="#link2" target="myFrame">Link 2</a></li>
		<li><a href="#link3" target="myFrame">Link 3</a></li>
	</ul>

	<iframe name="myFrame"></iframe>
</body>
</html>[/ignore]

It works fine in IE, although suffers from issues in Firefox (and possibly other browsers)... But if you're in an IE-only environment, it should suffice.

Hope this helps,
Dan

Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
HI,

Tried the above code as seen below
results in Links top text plus empty frame below,which gets filled up with the same links (Plus another small empty frame - nested) if I click one link at the top of the page...
Need advise here.Thanks

<script type="text/javascript">
var data = '';
#######################################<BR>
data +='<a NAME="EVNTLOG"></a>';
data +='<table width="100%" border="1" cellpadding="3" cellspacing="0">';
data +='<tr><td bgcolor="#C0C0C0"> <p style="font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 8pt; font-weight: bold; color: #000000"> Last errors from WIN32 event log <a HREF="#TOP">[Top]</a>&nbsp &nbsp <b style="color:blue"> </b> </p></td></tr>';
data +='<tr><td bgcolor="#FBEDBB"><PRE>';
data +='Last errors from WIN32 event log :';
data +='--------------------------------';

data +=' </PRE></td></tr></table>';
data +='###############################################################';
window.onload = function() {
var ifrm = window.frames['myFrame'];
ifrm.document.open();
ifrm.document.write(data);
ifrm.document.close();
}
</script>
</head>
<body><ul>
<H5><FONT COLOR=BlueViolet> System Information:</H5>
<LI><A HREF="#LMEMORY" target ="myFrame"><p style="font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 6pt; font-weight: bold; color:#0000EE"> Logical Memory Info</A></LI>
<LI><A HREF="#PMEMORY" target ="myFrame"><p style="font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 6pt; font-weight: bold; color:#0000EE"> Physical Memory Info</A></LI>
<BR>
</UL>
<iframe name="myFrame" width="75%" height="300" align="right"></iframe>
</body></html>


Long live king Moshiach !
 
actually you can use two div's inside one div either floated or absolute positioned. I used one scrolling div with in page links in the second div. The only browser that the links dont work in I think is opera version 6.

The basic code is
Code:
<div style="top:160px; left:160px">
<div style="top:160px; left:360px">
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>

<div style="whatever">Log info</div>
</div>

so it went something like this: (this is from one of my projects)

<div style="top:160px; left:160px" class="abposdiv"><p>&nbsp;</p>
<div class="rulescat">
<ul style="list-style:none; margin:0px; padding:0px">
<li>Rules & Regulations:
<ul style="text-indent:0.05em; list-style-image:url(sbbullet.gif); margin:0px; padding-left:25px">

<li><a href="#one">Uniforms & Equipment</a></li>
<li><a href="#two">Game</a></li>
<li><a href="#three">Runners & Batters</a></li>
<li><a href="#four">Pitcher-Pitching</a></li>
<li><a href="#five">Safety Regulations</a></li>

<li><a href="#six">Protests & Appeals</a></li>
<li><a href="#seven">Eligibility</a></li>
<li><a href="#eight">Tie Breaker Rules</a></li>
</ul>
</li>
<li>Conduct & Discipline:
<ul style="text-indent:0.05em; list-style-image:url(sbbullet.gif); margin:0px; padding-left:25px">

<li><a href="#nine">Team Responsibilities</a></li>
<li><a href="#ten">General Rules</a></li>
</ul>
</li>
</ul>
<br>
</div>

<div class="log">
your log info

</div>

</div>
 
HI,

Back to 2 frames in one html file ...
Now,guys ,we are struggling to make the left navigation frame be a folding tree ...
We know how to do it with 3 files,but not with just one HTML.
Cpuld you please help ?
Thanks

Long live king Moshiach !
 
I do so indeed as advised by BillyRayPreachersSon ,creating two JavaScript variables,building 2 frames from them later.

However folding the left (Javascripot build !) frame into a tree is not a simple issue...since int's not a simple HTML file.

Long live king Moshiach !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top