|
-
Sep 24th, 2005, 05:45 PM
#1
Thread Starter
Frenzied Member
[Javascript] - getElementById is not a function
I'm testing something on an old version of netscape, specifically 4.7. Everythings fine except for my javscript function doesn't work because it says getElementById is not a function:
document.getElementById('ncp').src = "ncp" + pictureNum + ".jpg";
I've got many more of these type lines but it works fine in IE and FF. Is there something I can do to make this compatible with netscape browsers?
-
Sep 25th, 2005, 09:10 AM
#2
Re: [Javascript] - getElementById is not a function
No. Netscape prior to the Mozilla project doesn't support getElementById. You have to use document.images['name'] to access images. However, note that this method only finds images if the name attribute is set, and won't find them by their id attribute. (I might be wrong about that last one, but I don't think so.)
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
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
|