Go Back   Computer Forums > Web Design | Website Development > Web Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 05-14-2009, 12:10 PM   #1
Solid State Member
 
choozay's Avatar
 
Join Date: Apr 2009
Posts: 18
Default HTML coding help

Hello,

Wandering if any one could help me with a quick coding issue.

Is there a way of using the html tag <a href> in a .txt file, i knw u can use the <b> tags in a txt file, but i'm having a problem in using the <a href> tag!!

For some reason at my work place they have a .txt file linking in to a HTML page. I need to add a link on the .txt file to point to a pdf file.

Cheers..
__________________

choozay is offline   Reply With Quote
Old 05-14-2009, 02:00 PM   #2
Baseband Member
 
Join Date: Sep 2004
Posts: 95
Default Re: HTML coding help

I guess the question is what are you using as a text editor. Depending on the program in use, you may be able to put a hyperlink in the txt document.

If you are talking about creating a file in notepad, naming it something.txt and you want to put a hyperlink in there that you can click on in notepad, it's not going to work because you will have no formatting at all in notepad, it's completely plain text.
__________________

__________________
As the sun sets, the earth shall prepare
ksb007 is offline   Reply With Quote
Old 05-14-2009, 02:15 PM   #3
Daemon Poster
 
wmorri's Avatar
 
Join Date: May 2007
Posts: 1,066
Send a message via AIM to wmorri
Default Re: HTML coding help

choozy,

why don't you just post a link to the pdf file in the html. Then it will just show up on the website, and they can bypass the text file altogether. As far as I know you can't put a link in a text file.

Cheers!
__________________
LEARN BY DOING NOT BY FOLLOWING DIRECTIONS!
Linux Forever!

I thought you were a hispanic/african american? Who is the white guy in the pictures?
wmorri is offline   Reply With Quote
Old 05-15-2009, 06:54 AM   #4
Solid State Member
 
choozay's Avatar
 
Join Date: Apr 2009
Posts: 18
Default Re: HTML coding help

ksb007 - I aint using no software, all being done by code. Well im not adding a hyperlink, im trying to code in a link to some documents on our webserver, I want to know if you could do this in a .txt file.

wmorri - I would if i could, for some reason, they have got a HTML, all txt within that HTML is being read from a seprerat .txt file. So i have to insert the link within that txt file. .

I knw they are using .asp Would this effect anything??

Cheers ! ! !
choozay is offline   Reply With Quote
Old 05-17-2009, 01:46 PM   #5
Baseband Member
 
Join Date: Sep 2004
Posts: 95
Default Re: HTML coding help

If the text for the HTML document is coming from a txt file, just include the tags for the hyperlink <a href></a> within the text file.

Then create something like a label or just use a <div> element and set the innerHTML as the text from the txt file.

<html>
<head>
<title>
</title>
<script type="text/javascript">
function setHTML()
{
document.getElementById("test").innerHTML = "<a href='http://computerforums.org'>This should work</a>"
}
</script>
</head>
<body>
<input type="button" onClick="setHTML();">
<div id="test"></div>
</body>
</html>

Above is a simple example but when you click the button, the link will appear. Instead of putting the link, in the innerHTML just replace it with the text from the txt file..
__________________
As the sun sets, the earth shall prepare
ksb007 is offline   Reply With Quote
Old 05-18-2009, 06:53 AM   #6
Solid State Member
 
choozay's Avatar
 
Join Date: Apr 2009
Posts: 18
Default Re: HTML coding help

KSB007 you lost me after your first sentance..lol..

Im kinda of new to HTML coding, what do you mean by create a label?? Would the code you gave go in to the HTML file that is reading from the .txt file or in the .txt file its self??

Sorry for my lack of knowledge dude..

Cheers..
choozay is offline   Reply With Quote
Old 05-18-2009, 09:58 AM   #7
In Runtime
 
Daeva's Avatar
 
Join Date: Dec 2005
Posts: 407
Send a message via AIM to Daeva Send a message via MSN to Daeva Send a message via Yahoo to Daeva
Default Re: HTML coding help

Unfortunately, you are working with custom code. It sounds like whatever you're working on is an asp document that reads in a text file for it's content. If this is the case, you should be able to put the hyperlink right in the text document, and the asp will import the text document and output it as html.
If it doesn't do this, one of two things are happening:
1.) The asp script is specifically weeding out hyperlinks (as a validation).
2.) The code has an error, or is not supposed to read html at all.

In either case, we could better help you if we saw both the text file and the asp page.

Hope this helps.

ksb007's solution should work. Basically what that means is to instead of a hyperlink in the text document, replace it with a <div> element that looks like this:
Code:
<div id="test">
</div>
The javascript will then replace that with a hyperlink. It should be noted that if this is for a website, a search engine will not be able to read this javascript link.
__________________

__________________
**Official Self-proclaimed glorified excessive (insert additional adjectives here) post editor/modifier.
Edit = Best feature ever
http://www.twitter.com/xDaevax
Daeva is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 06:14 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0