Solved

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

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
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…

696 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