|
-
March 18th, 2003, 12:47 PM
#1
JavaScript: Object expected
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.
Code:
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:
Code:
<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?
Captain Obvious
Documentation is your friend
-
March 18th, 2003, 12:50 PM
#2
Never mind. ^^
I was making an error in a completely different location that mungled the relative paths to the external .js. How stupid of me.
Captain Obvious
Documentation is your friend
-
April 7th, 2003, 11:14 AM
#3
In general, use Mozilla/Netscape javascript console to get more meaningful error messages. Just type javascript: in the address bar.
-
April 7th, 2003, 12:12 PM
#4
It wasn't even a javascript error, so I doubt that would help. But thanks.
Captain Obvious
Documentation is your friend
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|