Solved

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

Posted on 2004-08-04
2
250 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
XSL Grouping 7 42
jQuery or Javascript animation question 6 68
Specific format 21 196
Randomize in Owl Carousel v1.3.2 6 40
Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

813 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

11 Experts available now in Live!

Get 1:1 Help Now