Solved

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

Posted on 2004-08-04
2
257 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you work with shopping cart / ecommerce relates web sites, you need to pass the certain form post details to the payment gateway process page with required details for the products items you give to order. Also you may need to track the ordered…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

717 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