SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member Mara's Avatar
    Join Date
    Mar 2001
    Location
    Seattle
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question I am confused?!? (VERY basic question)

    Hi anyone and EVERYONE,
    I need help in understanding (a lot of things about dhtml) but mainly this particular small chunk of code:

    if(!document.all&&!document.getElementById)
    return

    if (!document.all&&document.getElementById)
    ns6_index=1


    is the first condition asking if it is a browser that does NOT support the dom at all...
    and is the second condition asking if it is NOT IE and is NN6???
    And what is the index of ns_6 actually doing (is it something to do with that text node that NN6 adds to the elements)???
    THANK YOU!,
    Mara

  2. #2
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You're right.

    The first condition states that the browser doesn't support document.id_references very well if it returns true.

    The second condition states that id's are supported, but not in a global collection... hence it must be NN6 - since that allows for getElementById but not the collection method document.all->

    The variable set (ns6_index) will then be in the future to determine how functions and events fire - but not automatically - you should see some scripted referneces in the if(ns6_index){} else {}.

    Hope this helps!

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •