Metaphor
March 18th, 2003, 11:47 AM
A common error, since it's so damned general that noone understands what it's pointing at. ;)
Well. I've got myself a function in an external .js file.
function swapImage(imgID, imgFile) {
document.images[imgID].src = '/newdesign/images/menubuttons/' + imgFile;
}
Simple as can be, right? Right.
Then, naturally, I've got an onMouseOver on a link that goes:
<a href="" onMouseOver="swapImage('imgHome','home_down.gif')"><img name="imgHome" src="home.gif"></a>
I can't for the life of me see anything wrong. Am I stupid? Is javascript stupid? Is the answer to the question about life, the universe and everything not 42?
Well. I've got myself a function in an external .js file.
function swapImage(imgID, imgFile) {
document.images[imgID].src = '/newdesign/images/menubuttons/' + imgFile;
}
Simple as can be, right? Right.
Then, naturally, I've got an onMouseOver on a link that goes:
<a href="" onMouseOver="swapImage('imgHome','home_down.gif')"><img name="imgHome" src="home.gif"></a>
I can't for the life of me see anything wrong. Am I stupid? Is javascript stupid? Is the answer to the question about life, the universe and everything not 42?