Results 1 to 2 of 2

Thread: [Javascript] - getElementById is not a function

  1. #1

    Thread Starter
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    [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?

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    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
  •  



Click Here to Expand Forum to Full Width