Other uses for links
by David Halls

Introduction
In a previous article, it was shown how to use links in menus to navigate from one part of a program to another and to call up procedures. There are other interesting things you can do with links as will be shown here.
Links to documents on your computer
Normally this works OK. The browser assumes you are downloading the document and may issue a warning. Files ending in " .txt", " .doc" and " .pdf" are fine since these documents are used often with web pages. Spreadsheets as " .xls" documents may issue a warning, but on the warning there is a tickbox against the message "Always ask before opening this type of file". If you click this tickbox to clear the tick, the next time you access that type of file, no warning will appear.
You can also link to programs (*.exe), but a warning will always be issued, even if you convert the menu file into an HTA (*.hta). There is a way to link to programs through the Shell object in Windows Script Host, which is relatively straightforward and gets you there without a warning.
<a href ="C:\html progs\temp.txt">Text file</a> <a href ="C:\Invoices and Accounts\accounts.xls">Accounts spreadsheet</a> <a href ="C:\Program Files\Microsoft Office\winword.exe">Word Program</a>
A link can be used to produce an e-mail form in your default e-mail program. Some examples:-
The first case sets up a form to e-mail Joe Bloggs, the second just opens a blank form for you to insert the e-mail address from the address book. The third case sets up a complete e-mail including the subject and message("body"). This construction is probably only suitable for short e-mail messages, but could be programmed.
Titles

A link can have a property called title which will show like a tool tip when the mouse is over the link. This can be useful when navigation links need to be kept short. The title can give more information about use of the link.
<a href ="Mailto:" title = "Opens a blank e-mail form for you to complete">Send e-mail</a>
Directories or Folders
This, to me, is one of the most exciting ways of using a link other than to a location on the internet. Microsoft extended the concept of the URL from simply a location in the internet to any location on your computer or on a network. Internet Explorer was designed as a file explorer which is used as part of the Windows operating system. If you link to "C:" or a folder, the files and folders in that location are displayed. The screenshot at the top of this article shows the menu program described in a previous article in which the document or page accessed is displayed in a large iframe. In this shot, the link activated is to a folder on the computer. Thus, if you are setting up a menu for a particular project or hobby, you can include links to the folders you commonly use in that work. As it is the file explorer that is displayed, you can click on any file of folder displayed to activate it.
If you wish to try it (and you are using Windows and Internet Explorer), try this link. Your C: Drive.
FTP to website
Another interesting use of a link is to an FTP address. It is particularly useful in loading pages to a website. Here are two ways in which it can be used:-
The first example links to the ftp site for your website. You will need to enter your username and password when asked before you are allowed to enter. The second option incorporates this information in the link. Substitute username with the username you were given for access and similarly your password for password. This is obviously not very secure, as anyone using your computer could directly access your website or retrieve your username and password from the code. It is, however, very convenient if the security risk at your site is low.
If you also have a link to the folder on your computer where you prepare your webpages, you can first go to that folder, select those files you want to upload. Then press CTRL + C to copy. Then click on the ftp link to your web folder. Click on the folder frame to ensure that it is the active window. Then press CTRL + V to paste. Simple!
Run a script
There are two simple examples of this in the menubar at the top of this page - Print this page and Return. The code for this is:
<a href = "#" onClick="window.print()">Print this page</a> <a href = "#" onClick="history.go(-1)">Return</a>
The event OnClick could equally well run a subroutine, as shown in a previous article.