Solved

I would like to extract data from a text file onto an htm page including hyperlinks...

Posted on 2004-08-04
2
245 Views
Last Modified: 2013-11-18
I would like to extract text from a text file and display it onto an htm page..this I have managed to do, what I am having trouble with is including hyperlinks within this text from the *.txt file.


My htm file:

<body>
<table width=70% border=0 cellspacing="40">
<tr>
   <td width=50%><span class="style1"> Title:</span>
     <script src="settext.js"></script></td>
</tr>
<tr>
  <td width=50% class="style2"><span class="style1"> Body:</span>
     <script src="hyperlink.txt"></script>
</font>
   </td>
</tr>
</table>
</body>



My .txt file:

var tdContent1=""
tdContent1="<b>This text will be displayed on the .htm page</b>"
document.write(tdContent1);
0
Comment
Question by:rabbits2
2 Comments
 
LVL 7

Accepted Solution

by:
mark-b earned 125 total points
ID: 11720255
Your above code works for me, and with this slightly modified hypertext.txt file:

var tdContent1=""
tdContent1="<b>This text will be displayed on the .htm page</b><a href='http://www.experts-exchange.com'>EE</a>";
document.write(tdContent1);

-Mark
0
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11722366
I guess that your error come from using " (double quote) in anchor tag. Like mark-b example. you should use ' (single code) instead.

Hope this can correct.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now