> This nav bar is working fine in NS4/Mac but is giving me some weird
> Javascript errors, broken links up in the top "label selector" section:
>
> http://hazel.forest.net/shrapnelrecords/nav.html
>
> If anyone can spot the problems, I might feel grateful enough to send
> homemade chocolate chip cookies. (And if you knew how much I dislike
> cooking, you'd know how desperate I am!)

At first glance, it looks like you are not preloading all the images. I
tested in IE4 and am not getting any errors. Now, to look under the hood:

In this section, try removing the 2 lines marked with a * below:

* function preLoad() {

imageList=new Array("redshrap.gif",      "redshrap_c.gif",
                    "redshrap_x.gif",    "redbb.gif",
                    "redbb_c.gif",  "redbb_x.gif",
                    "redtc.gif",      "redtc_c.gif",
                    "redtc_x.gif",    "redint.gif",
                    "redint_c.gif",    "redint_x.gif",
                     "address_x.gif");


    onImage=new Array();

    if(document.images)
    {
        for (field in imageList)
        {
          onImage[field]=new Image();
          onImage[field].src=imageDir+imageList[field];
        }
    }
* }

This will cause the entire routine to be run when the page loads. As is, the
function "preLoad" is not called anywhere else on the page.

There may be other things, but that caught my eye first.

You could also check document.images capability prior to running the code,
which will cut down on errors. Here's a rewrite:

if(document.images){
        imageList = new Array("redshrap.gif",           "redshrap_c.gif",
                                        "redshrap_x.gif",       "redbb.gif",
                                        "redbb_c.gif",          "redbb_x.gif",
                                        "redtc.gif",            "redtc_c.gif",
                                        "redtc_x.gif",          "redint.gif",
                                        "redint_c.gif",         "redint_x.gif",
                                        "address_x.gif");
        onImage=new Array();
        for (field in imageList){
          onImage[field]=new Image();
          onImage[field].src=imageDir+imageList[field];
        }
}

I'd also move all the script stuff so that it's between one set of

<SCRIPT LANGUAGE = "Javascript">
<!--

//-->
</script>

but that's just academic...I don't think it'll make any browsers choke, but
it'll make things easier to read, since they'll all be in one place.

Jack

____________________________________________________________________
--------------------------------------------------------------------
 Join The Web Consultants Association :  Register on our web site Now
Web Consultants Web Site : http://just4u.com/webconsultants
If you lose the instructions All subscription/unsubscribing can be done
directly from our website for all our lists.
---------------------------------------------------------------------

Reply via email to