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

Embeding a text file

Status
Not open for further replies.

Blobishthing

Programmer
Feb 16, 2002
23
AU
I am trying to embed a text file into my page but when i open the page there is no writing but there is the text box please help.
This is how i am trying to do it...

<OBJECT WIDTH=&quot;550&quot; HEIGHT=&quot;400&quot; >

<PARAM NAME=&quot;TEXT&quot; VALUE=&quot;thing.txt&quot;>

<EMBED SRC=&quot;thing.txt&quot; WIDTH=&quot;550&quot; HEIGHT=&quot;400&quot;>

</EMBED>

</OBJECT>
 
You cannot embed a text file. Do this:
put your text in JS variable and save the file as text.js file:

------
var txt = &quot;your very long text string here&quot;;

function print()
{
document.write(txt);
}
------

Note that you cannot break a string pressing Enter, everything should be in one line.
Attach the file to the webpage:
<head>
<script src=&quot;text.js&quot;>
</head>

and then place the text in the desired place of your page like this:
<script>print();</script>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top