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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTML Include 1

Status
Not open for further replies.

link9

Programmer
Nov 28, 2000
3,387
US
Can someone tell me how to include a .txt file's contents on a webpage?

If the page is ASP, it's simple, just include this:
<!-- #include file=&quot;someFile.txt&quot; -->

But this won't work on an .htm page.

Does someone know what will?

Thanks! :)
Paul Prewett
penny.gif
penny.gif
 
Try :

<script src=&quot;someFile.txt&quot;></script> Regards

Big Dave

davidbyng@hotmail.com


** If I am wrong I am sorry, but i'm only trying to help!! **

 
If you can handle an IE only solution...

Look into the Tabular Data Control on MSDN. While it was meant for much fancier stuff, you can use it to load text from a web-based .txt file, and stuff the text into something like a <DIV> via its innerText property.
 
Assuming your web server supports SSI's, try renaming your page to something.shtml and the includes should be processed.
One by one, the penguins steal my sanity.
 
Thanks, ayjaycee. Just what I was looking for.

:)
paul
penny.gif
penny.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top