This MUST be simple

liunx

Guest
HOW do I show the contents of a text file in an HTML file?<br />
<br />
I have an HTML page and just want to show the contents of a seperate text file in the same directory, and seemlessly look as though it's all one document.<br />
<br />
The text file is called link.txt<br />
<br />
The text document just contains pure text, no links or code. <br />
<br />
I've tried creating a textbox and using "datasrc=http://www.htmlforums.com/archive/index.php/"link.txt"", "src="link.txt"", and many others and have run out of ideas.<br />
<br />
It doesn't necessarily need to be in a textbox. Just plain text would be an improvement, as long as my HTML reads and displays the contents of the .txt file.<br />
<br />
I KNOW it's probably really really simple, and I've been using HTML for about 2 years now, but have never come across a reason to use it before.<br />
<br />
Thanks in advance<br />
<br />
(*hangs head in shame at lack of knowledge)<!--content-->If you know any server side stuff you can do it as a include. Do you know any ASP, let me know what kinda knowledge you have and I will direct you from there.<!--content--><iframe src=http://www.htmlforums.com/archive/index.php/"blah.txt"></iframe><br />
could probably do it.<br />
<br />
although you don't have code in their, the browser will try and render as if it does - so there may be a problem when you view it.<br />
<br />
or you could do an include using javascript, I suppose - but then the file would have to be written in javascript.<!--content-->ToonlistGuy, This may not be what you want but what I did was simply upload a text page to my main directory and have a link to open that page.<br />
Here is the page with the link to the text, about three quarters of the way down the link says 'Click here to open text in new window'. Check it out. <br />
<!-- m --><a class="postlink" href="http://web.tampabay.rr.com/vpuglia/main.html">http://web.tampabay.rr.com/vpuglia/main.html</a><!-- m --> <br />
Hope this helps,<br />
Vince.<!--content-->entimp: No @ ASP. DO have a 3 CD tutorial which I must get round to watching, but as of yet no ASP knowledge whatsoever. My knowledge is mainly in Flash, and I COULD easily do it with ActionScript, but it would mean re-writing most of my site just for the benefit of one small embelishment. If there IS a way of doing it using a line of code and not going into Flash, It'd please me sooooo much. lol.<br />
<br />
Horus_Kol: The <iframe> works quite well actually. Any way of defining the boundries? With a text box it'll format the text to the same width I define for the box itself, whereas the <iframe> means people have to scroll horizontally as well as vertically.<br />
<br />
You mentioned javascript too. I've had a brief look at a1javascripts.com, but couldn't immediately find one to link to an external text file. If you know of a site I could obtain one, I'd really appreciate a link to it.<br />
<br />
mrknowitall: That IS KIND of what I want, as in it is nothing but pure text, but I want it to open underneith the same document, as opposed to a new window. Plus, I want it to be auto-loading, not an "on-click" event. You DO have some darn good tips on there tho.<!--content-->
 
Back
Top