Hi
I want to make a link that reads its location from a .txt file.
Is that possible in html or do I have to use javascript?
If you could tell me how to do it in Dreaweaver or give example code that would be Fantastic! :D
Thanks in advance
Dan V
Printable View
Hi
I want to make a link that reads its location from a .txt file.
Is that possible in html or do I have to use javascript?
If you could tell me how to do it in Dreaweaver or give example code that would be Fantastic! :D
Thanks in advance
Dan V
HTML won't do it. Javascript might not do it. The best way is to do it on the server as the page is being rendered.
ray326 is correct. Best way to do this, is by using some server side language like asp/php etc. html and javascript can't do it.
In that case I will probably use flash which does it quite easily.
Thanks anyway.
Dan V
not true. A simple Server Side Include is your simplest solution:Quote:
Originally Posted by mrizwan
<!--#include virtual="/pathto/your.txt" -->
will insert the code in your.txt as html
you will need to ensure that ssi's are allowed on your server, easiest way is with an .htaccess edit
http://www.javascriptkit.com/howto/htaccess4.shtml
http://www-ss.com/tutorials/htaccess/htaccess_04.htm
I use it extensively on my site:
Trailers in PA NY OH
though you won't see it in the source as it is parsed as plain old html in all browsers
I have almost the same problem. Iam trying to read from a text file but i want to be able to read the links around my text? i have searched alot and i count find any thing so any help will be appreciated.
You could use a javascript AJAX call to read the text file given that:
a) the text file is on the same server as the website
b) the text file is accessible via http, i.e. it sits within the website's root directory somewhere.
The drawback to doing it this way is that anyone who reads the javascript for the AJAX call will then know how to directly access the text file via HTTP, so it's probably not a good idea to put any sensitive/private information in the text file.