Web Analytics Made Easy -
StatCounter javascript not working in NN 4.7 - CodingForum

Announcement

Collapse
No announcement yet.

javascript not working in NN 4.7

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • javascript not working in NN 4.7

    I have the following portion of javascript and in NN 4.7 it gives an error.

    The Code:
    img name="fullDocImageCit"
    if (document.images[fullDocImageCit]) {
    document.fullDocImageCit[0].src="avtop.gif"

    And in NN 4.7 it says
    document.fullDocImageCit[0] has no properties

    I know somethng is wrong in the way I wrote the [fullDocImageCit] but dont know how to fix it.

  • #2
    document.images[fullDocImageCit] will use the value stored in the variable named fullDocImageCit. presumably that variable doesn't exist so it's filling it in with "undefined" or some such.

    document.images["fullDocImageCit"] will use the string value "fullDocImageCit" and may give you what you want.

    Comment


    • #3
      document.fullDocImageCit[0].src is an IE only shortcut. You've got the right reference in the IF statement but then jump to the wrong (proprietary) reference afterwards.

      document.images[fullDocImageCit].src will work and it'll fix the same problem which would appear in a modern browser, not just that obsolete antique NS 4.7.
      Check out the Forum Search. It's the short path to getting great results from this forum.

      Comment

      Working...
      X