• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 262
  • Last Modified:

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

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:

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

My .txt file:

var tdContent1=""
tdContent1="<b>This text will be displayed on the .htm page</b>"
1 Solution
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>";

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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now