| Java menu knowledge base XIXL - LINK command
The LINK command works in much the same way as the HTML tags for
creating hyperlinks, providing both a URL and a target frame possibility.
Paths
Example 1:
"LINK:localfile.htm,myFrame"
Example 2:
"LINK:directory/localfile.htm,myFrame"
Example 3:
"LINK:/directory/localfile.htm,myFrame"
Example 4:
"LINK:./directory/localfile.htm,myFrame"
Example 5:
"LINK:../directory/localfile.htm,myFrame"
Example 6:
"LINK:http://www.hostname.com/file.htm,myFrame"
Example 1 loads a page that is in the same directory
as the HTML file calling the applet. Example 2 loads a page in a sub-directory of
the directory that holds the calling HTML file. Example 3 loads a page in a sub-directory
of your host server - note the / (!) - if you don't understand this, experiment.
Example 4 is another way of writing example 2 (some regard it as safer). Example
5 loads a file in a sub-directory of the parent directory - i.e. in a sister
diretory to the current directory. Example
6 loads a non-local file.
Avoid using spaces in your URL's. Links containing
spaces may work with Microsoft software, but may not cooperate
with Linux/Unix/Netscape.
Protocols
Any "http://" protocol URL may be entered as a link. Other protocols have
not been tested, but will probably work. Some early and/or rare browsers
may have java interpreters that do not understand all standard internet
protocols. An example is the "mailto:" protocol, which did not work with
IE3. With "mailto:" URL's you should also specify a frame - "_self" is recommended;
e.g. "LINK:mailto:info@imint.com,_self".
A further "protocol" which is frequently of interest is "javascript:".
Browser interpretation of this is inconsistent and mostly negative.
Use the SCRIPT command instead (available with most applets and used
for launching a javascript).
Anchors
The URL may be suffixed by an anchor (e.g. "myPage.html#myAnchor"). This works
with Netscape 3+, and IE 4+. IE 3 fails to recognize java anchors and loads
the page at the top instead (a browser limitation, not an applet limitation).
Filetypes
The link function works with all ascii filetypes (including HTML and text
documents). We have also seen people entering all kinds of executable code
files into the URL link to activate server programmes. While we have not
tested executable filetypes ourselves, we have no reason to believe they
won't work - try it! But be warned that early and/or rare java interpreters
may reject such URL's.
Unavailable characters
Some unusual characters may corrupt or disable the links on some browsers.
For example, URL's with spaces will NOT work under recent Netscape browsers.
Best solution: don't use spaces. The URLE command may help here. Or
you could manually convert such characters to URL-encoded format (%xx).
Frames
As well as named frames (i.e. named in the HTML code of your site), the applet also
accepts all pre-defined HTML targets such as "_blank" and "_top".
The value "_blank" opens a new window
and the value "_top" overrides any existing frames and places the document at
the top of the browser's display hierarchy.
More information about using frames is in the frames FAQ
|
|