Results 1 to 4 of 4

Thread: What does this mean???

  1. #1
    Join Date
    Oct 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question What does this mean???

    And can someone please explain the following coding from Dynamic Drive's tab menu to me?

    var menuobj=document.getElementById? document.getElementById("describe") : document.all? document.all.describe : document.layers? document.dep1.document.dep2 : ""

    Regards,
    Phoebe

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    It's basically referencing the element on the page with ID="describe" using 3 different methods, depending on whether the browser is DOM compliant, IE4, or NS4, respectively. For example:

    document.getElementById("describe")

    accesses the element using the DOM.

  3. #3
    Join Date
    Oct 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by ddadmin
    It's basically referencing the element on the page with ID="describe" using 3 different methods, depending on whether the browser is DOM compliant, IE4, or NS4, respectively. For example:

    document.getElementById("describe")

    accesses the element using the DOM.
    First, thank you for your reply.

    Second, another 2 questions, 1.why do they put a question mark behind the document.getElementById @ the first time?

    2.function resetit(e){
    if (document.all&&!menuobj.contains(e.toElement))
    delayhide=setTimeout("showit(-1)",delay_hide)
    else if (document.getElementById&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
    delayhide=setTimeout("showit(-1)",delay_hide)
    } <=== what is this function for?




    Regards,
    Phoebe
    Last edited by usdream; 10-15-2004 at 01:20 PM.

  4. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    To answer your questions:

    1) The question mark is called the Conditional Operator in JavaScript- a shorthand if/else logic statement if you will. For more info, see bottom of: http://www.javascriptkit.com/jsref/operators.shtml

    2) Are you referring to function resetit() in general?

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
  •