Information Center
Navigator Properties Examples | Document.referrer Examples | HyperText Links to Functions | MouseOvers's




Java Script: The mouseOver command



This Java Script enables the user to manipulate the status bar at the bottom of the window. The default setting for it is the URL of the Hypertext link that the mouse is over. However, this can be changed by a few simple java commands.
This simply a normal HyperText Markup Language A HREF tag. By includeing the onMouseover command you can display your own message in the status bar for each of your Hyper Text links. In this example the onMouseover command displays the message in the status bar. While the onMouseout clears the status bar after the mouse is moved off the link.



Simply change the __URL__, ___YOUR_MESSAGE___,___YOUR_TEXT___, to the URL you wish to link to, the message you wish to display, and the text you wish to appear in the hypertext link.

<A HREF="__URL__" onMouseover="self.status='___YOUR_MESSAGE___';return true" onMouseout="self.status='';return true">___YOUR_TEXT___</A>



Example:

A link to no where





Java Script: HyperText Links to Functions



This Script Produces in effect a Image button. Normal Button are done with forms, and produce the standard gray buttons with text in the middle. These buttons Link (as far as I know) only to Script Functions. There is, however, another way to produce the same affect. Useing a normal hypertext link with a image you insert in the URL position the text:
JavaScript: functionname().
functionname being the name of the function you wish to call. In this way the Image calls a function instead of a URL and you are able to produce a button from Image Hypertext Link.

Note: It is also possible to call a function from a normal HyperText Link.



Do Not Copy the Script directly from the screen and into your HTML document.
  • Don't forget to first change the __Your_Image__.jpg to the filename of your Image.
  • Don't forget to change the Message to your desired message. This code fragment is just an Example and should be changed to fit your needs, rather than just copying it.



    <SCRIPT>
    function message(message)
    {
    alert(message);
    }
    </SCRIPT>
    <A HREF="JavaScript: message('This a alert Message!')">
    <IMG SRC="__YOUR_IMAGE__.JPG"></IMG></A>



    Example:








    Java Script: Using navigator.appName



    This Script shows the usage of a few of the navigator properties.

  • navigator.appName
  • navigator.appVersion

    There are more properties but they are not used in this example. These properties can also be used to detect the type browser that is accessing your page.

    The third line of the script detects the navigator type and if the person accessing your page is using Microsoft Internet Explorer it displays a message(lines 5 and 6) telling them that they should use Netscape Navigator. You may change this to say anything, and to detect Netscape Navigator if you wish to do something else.



    Copy the Script directly from the screen and into your HTML document.



    <SCRIPT>
    document.write('You are Using: <FONT SIZE=5>' + navigator.appName + navigator.appVersion + '<BR> </FONT>');
    if(navigator.appName == "Microsoft Internet Explorer")
    {
    document.write('Microsoft Internet Explorer Does not support some JavaScript properties');
    document.write('You may wish to download Netscape Navigator <A HREF=' +http://www.netscape.com+ '>Here</A>');
    }
    </SCRIPT>


    Example:






    Java Script: Using the Document.referrer



    This simple Script will show the refering URL and provide a link to it. This script only works if the page it is on, is accessed through a HyperText Link.
    Note: Only works in Netscape.

    Copy the Script directly from the screen and into your HTML document.



    <SCRIPT>
    if(navigator.appName == "Netscape")
    document.write('Return to the previous page: ');
    document.write('<A HREF=' +document.referrer+ '>' + document.referrer + '</A>');
    </SCRIPT>


    Example:





    The same script used with a button

    Copy the Script directly from the screen and into your HTML document.




    <FORM>
    <INPUT TYPE="button" VALUE="Return To Previous Page" onClick="document.location.href=document.referrer">
    </FORM>



    Example: