I’m not very good with HTML, so I leave the details to someone else, but perhaps this will help. It seems to me that you should clarify among three options here:
[ol]
[li]An external script that scans an HTML file, inserts the correct hyperlink, and writes a new HTML file[/li][li]Read from a file as the web page is loaded, creating the link’s object dynamically[/li][li]When a link is clicked, read from a file to “locate” the proper URL[/li][/ol]
Sounds to me like neither (1) nor (2) are what you want. For (1), you write the HTML, run the script, and get a new HTML file with the correct links (this would be something like using sed or perl on a pre-existing file). For (2), you would be dynamically serving the page. For (3), you might do something like the following; it’s some javascript I wrote for bibliography display. Each displayed item is followed by a link with a specified file name. When clicked, it will pop a window that displays the contents of the specified file. Here’s the javascript function:
<script language="JavaScript" type="text/javascript">
<!--
function popbibtex(bibentry) {
bibwin = window.open(bibentry, "bibtexwindow", "menubar=1,scrollbars=yes,resizable=1,width=800,height=250,top=100,left=100");
}
// -->
</script>
And here’s how it’s used:
<!--
(<a href="javascript: popbibtex('./bibitem1.txt')">bibitem1</a>)
-->
When the link that is displayed as bibitem1 (from the second code window) is clicked, the contents of bibitem1.txt is displayed in a popup window. Normally, of course, the link is preceded by a bibliography entry, which I left out to avoid the clutter.
It sounds to me like you actually want to keep all your terms and definitions in a single file, which will require code to search the file and extract what you want. Hope that somewhat clarifies the issue and helps a bit.