why won't this work?
This code doesn't do anything useful as it appears but it does demonstrate my problem. The problem seems to be with my syntax.
The problem I have is giving the value of the parameter that is passed in through the function fade_in() and
using it to identify the correct image within an array. It tells me that it is null or not an object.
It appears to be very simple but I can't figure it out.
------------
in the head tag:
var overButtons = new Array();
overButtons["development"] = new Image(146,18)
overButtons["development"].src= "../images/development.gif";
function fade_in(imageURL)
{
...............code........
var tempURL = overButtons["development"].src;//this works naturally
var tempURL2 = overButtons[imageURL].src; //there is a problem with this line for some reason
.........code..............
}
-------------
in the body
<a href="#" onMouseOver=fade_in('development');"><img name="development" src="../images/development.gif"></a>
This code doesn't do anything useful as it appears but it does demonstrate my problem. The problem seems to be with my syntax.
The problem I have is giving the value of the parameter that is passed in through the function fade_in() and
using it to identify the correct image within an array. It tells me that it is null or not an object.
It appears to be very simple but I can't figure it out.
------------
in the head tag:
var overButtons = new Array();
overButtons["development"] = new Image(146,18)
overButtons["development"].src= "../images/development.gif";
function fade_in(imageURL)
{
...............code........
var tempURL = overButtons["development"].src;//this works naturally
var tempURL2 = overButtons[imageURL].src; //there is a problem with this line for some reason
.........code..............
}
-------------
in the body
<a href="#" onMouseOver=fade_in('development');"><img name="development" src="../images/development.gif"></a>