tags:

views:

44

answers:

2

I'm looking for something similar to the a html a tag title text but I want the text to come from a separate file.

For example

<a href="xyz.htm" title="how do I retrieve this text from a file?">whatever</a>
A: 

Javascript cannot read from file.

But anyway that is not what you want. You most probably want the text to come from a file in the server, rather than a file from the client machine.

You need server side technologies (PHP, ASP, JSP/java...) for this.

UPDATE:
Ok. You don't have server side technologies. So this is not directly possible. But, first: how are yout HTML pages generated? Hand-coded or generated by some system (a CMS, for instance)?

If you are hand coding your HTML, you need the content of the "title" dynamically (from a file), then this is not possible. HTML or related technologies cannot "directly" read a file, and definitely not a file on the server.

If your HTML is generated by some sort of a generator, then possibly you can integrate this with that system itself.

I absolutely have no idea about the requirements, but is it possible to generate the HTML file based on your "configuration" file with the text everytime the text file changes.

BTW, how complex is your HTML?

Nivas
I have no access to server side technologies.
Mike D
See my update..
Nivas
The html files are generated by a c++ program I wrote that digests a genealogical database and cranks out thousands of html files. It's no problem for me to stuff the right stuff in the titles. On the other hand had it been possible to put this pop up text in files I would have preferred that so as to avoid duplication (their will be thousands of different pop ups each appearing in multiple <a> tags) and allow more complicated pop ups (multiple lines).
Mike D
Am not sure whether I explained correctly. What I meant was: you have a C++ program that generates these HTMLs, the only option I see is that this C++ program reads the files and sets this title. I understand this means that you have to regenerate the HTMLs everytime the tect in the file changes, but that is the only option.
Nivas
+1  A: 

IF you do not have access to server side scripting, then you can have your javascript make an ajax request to the file. Javascritp can open files, but they have to be server readable.

Colum